mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 13:14:44 +02:00
NotificationManager now uses a getter in mcMMO
This commit is contained in:
@ -10,7 +10,6 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
@ -88,7 +87,7 @@ public class AcrobaticsManager extends SkillManager {
|
||||
ParticleEffectUtils.playDodgeEffect(player);
|
||||
|
||||
if (mcMMOPlayer.useChatNotifications()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Acrobatics.Combat.Proc");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Acrobatics.Combat.Proc");
|
||||
}
|
||||
|
||||
//Check respawn to prevent abuse
|
||||
|
@ -5,10 +5,10 @@ import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillActivationType;
|
||||
@ -90,12 +90,12 @@ public class ArcheryManager extends SkillManager {
|
||||
defender.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 20 * 10, 10));
|
||||
|
||||
|
||||
if (NotificationManager.doesPlayerUseNotifications(defender)) {
|
||||
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Combat.TouchedFuzzy");
|
||||
if (mcMMO.getNotificationManager().doesPlayerUseNotifications(defender)) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Combat.TouchedFuzzy");
|
||||
}
|
||||
|
||||
if (mcMMOPlayer.useChatNotifications()) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.TargetDazed");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.TargetDazed");
|
||||
}
|
||||
|
||||
return Archery.getDazeBonusDamage();
|
||||
|
@ -10,7 +10,6 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.*;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -89,14 +88,14 @@ public class AxesManager extends SkillManager {
|
||||
Player player = getPlayer();
|
||||
|
||||
if (mcMMOPlayer.useChatNotifications()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.CriticalHit");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.CriticalHit");
|
||||
}
|
||||
|
||||
if (target instanceof Player) {
|
||||
Player defender = (Player) target;
|
||||
|
||||
if (NotificationManager.doesPlayerUseNotifications(defender)) {
|
||||
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.CritStruck");
|
||||
if (mcMMO.getNotificationManager().doesPlayerUseNotifications(defender)) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.CritStruck");
|
||||
}
|
||||
|
||||
damage = (damage * mcMMO.getConfigManager().getConfigAxes().getConfigAxesCriticalStrikes().getDamageProperty().getPVPModifier()) - damage;
|
||||
@ -145,14 +144,14 @@ public class AxesManager extends SkillManager {
|
||||
target.setVelocity(player.getLocation().getDirection().normalize().multiply(mcMMO.getConfigManager().getConfigAxes().getGreaterImpactKnockBackModifier()));
|
||||
|
||||
if (mcMMOPlayer.useChatNotifications()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.GI.Proc");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.GI.Proc");
|
||||
}
|
||||
|
||||
if (target instanceof Player) {
|
||||
Player defender = (Player) target;
|
||||
|
||||
if (NotificationManager.doesPlayerUseNotifications(defender)) {
|
||||
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.GI.Struck");
|
||||
if (mcMMO.getNotificationManager().doesPlayerUseNotifications(defender)) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.GI.Struck");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.*;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
@ -312,7 +311,7 @@ public class FishingManager extends SkillManager {
|
||||
}
|
||||
|
||||
if (enchanted) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Fishing.Ability.TH.MagicFound");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Fishing.Ability.TH.MagicFound");
|
||||
}
|
||||
|
||||
if (mcMMO.getConfigManager().getConfigFishing().isAlwaysCatchFish()) {
|
||||
|
@ -15,7 +15,6 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.*;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
@ -108,7 +107,7 @@ public class HerbalismManager extends SkillManager {
|
||||
ItemStack seed = new ItemStack(Material.WHEAT_SEEDS);
|
||||
|
||||
if (!playerInventory.containsAtLeast(seed, 1)) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Herbalism.Ability.GTe.NeedMore");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Herbalism.Ability.GTe.NeedMore");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -195,7 +194,7 @@ public class HerbalismManager extends SkillManager {
|
||||
*/
|
||||
public boolean processGreenThumbBlocks(BlockState blockState) {
|
||||
if (!RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.HERBALISM_GREEN_THUMB, getPlayer())) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Herbalism.Ability.GTh.Fail");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Herbalism.Ability.GTh.Fail");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -234,7 +233,7 @@ public class HerbalismManager extends SkillManager {
|
||||
}
|
||||
blockState.setType(Material.AIR);
|
||||
Misc.dropItem(location, treasure.getDrop());
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Herbalism.HylianLuck");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Herbalism.HylianLuck");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -252,12 +251,12 @@ public class HerbalismManager extends SkillManager {
|
||||
PlayerInventory playerInventory = player.getInventory();
|
||||
|
||||
if (!playerInventory.contains(Material.BROWN_MUSHROOM, 1)) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Skills.NeedMore", StringUtils.getPrettyItemString(Material.BROWN_MUSHROOM));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Skills.NeedMore", StringUtils.getPrettyItemString(Material.BROWN_MUSHROOM));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!playerInventory.contains(Material.RED_MUSHROOM, 1)) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Skills.NeedMore", StringUtils.getPrettyItemString(Material.RED_MUSHROOM));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Skills.NeedMore", StringUtils.getPrettyItemString(Material.RED_MUSHROOM));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -266,7 +265,7 @@ public class HerbalismManager extends SkillManager {
|
||||
player.updateInventory();
|
||||
|
||||
if (!RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.HERBALISM_SHROOM_THUMB, player)) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Herbalism.Ability.ShroomThumb.Fail");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Herbalism.Ability.ShroomThumb.Fail");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@ import com.gmail.nossr50.util.BlockUtils;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
@ -123,7 +122,7 @@ public class MiningManager extends SkillManager {
|
||||
TNTPrimed tnt = player.getWorld().spawn(targetBlock.getLocation(), TNTPrimed.class);
|
||||
|
||||
//SkillUtils.sendSkillMessage(player, SuperAbilityType.BLAST_MINING.getAbilityPlayer(player));
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUPER_ABILITY, "Mining.Blast.Boom");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUPER_ABILITY, "Mining.Blast.Boom");
|
||||
//player.sendMessage(LocaleLoader.getString("Mining.Blast.Boom"));
|
||||
|
||||
tnt.setMetadata(MetadataConstants.TNT_TRACKING_METAKEY, mcMMOPlayer.getPlayerMetadata());
|
||||
@ -262,7 +261,7 @@ public class MiningManager extends SkillManager {
|
||||
|
||||
if (timeRemaining > 0) {
|
||||
//getPlayer().sendMessage(LocaleLoader.getString("Skills.TooTired", timeRemaining));
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.ABILITY_COOLDOWN, "Skills.TooTired", String.valueOf(timeRemaining));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.ABILITY_COOLDOWN, "Skills.TooTired", String.valueOf(timeRemaining));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
@ -50,7 +49,7 @@ public class RepairManager extends SkillManager {
|
||||
}
|
||||
|
||||
if (mcMMO.getConfigManager().getConfigRepair().getRepairGeneral().isAnvilMessages()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Repair.Listener.Anvil");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Repair.Listener.Anvil");
|
||||
}
|
||||
|
||||
if (mcMMO.getConfigManager().getConfigRepair().getRepairGeneral().isAnvilPlacedSounds()) {
|
||||
@ -66,18 +65,18 @@ public class RepairManager extends SkillManager {
|
||||
Repairable repairable = mcMMO.getRepairableManager().getRepairable(item.getType());
|
||||
|
||||
if (item.getItemMeta().isUnbreakable()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Anvil.Unbreakable");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Anvil.Unbreakable");
|
||||
return;
|
||||
}
|
||||
|
||||
// Permissions checks on material and item types
|
||||
if (!Permissions.repairMaterialType(player, repairable.getRepairItemMaterialCategory())) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Permissions.repairItemType(player, repairable.getRepairItemType())) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -86,7 +85,7 @@ public class RepairManager extends SkillManager {
|
||||
|
||||
// Level check
|
||||
if (skillLevel < minimumRepairableLevel) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Skills.Adept", String.valueOf(minimumRepairableLevel), StringUtils.getPrettyItemString(item.getType()));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Skills.Adept", String.valueOf(minimumRepairableLevel), StringUtils.getPrettyItemString(item.getType()));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -121,7 +120,7 @@ public class RepairManager extends SkillManager {
|
||||
|
||||
// Do not repair if at full durability
|
||||
if (startDurability <= 0) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Skills.FullDurability");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Skills.FullDurability");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -184,7 +183,7 @@ public class RepairManager extends SkillManager {
|
||||
}
|
||||
|
||||
actualizeLastAnvilUse();
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Skills.ConfirmOrCancel", LocaleLoader.getString("Repair.Pretty.Name"));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Skills.ConfirmOrCancel", LocaleLoader.getString("Repair.Pretty.Name"));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -291,7 +290,7 @@ public class RepairManager extends SkillManager {
|
||||
return false;
|
||||
|
||||
if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.REPAIR_SUPER_REPAIR, getPlayer())) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Skills.FeltEasy");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Skills.FeltEasy");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -313,7 +312,7 @@ public class RepairManager extends SkillManager {
|
||||
}
|
||||
|
||||
if (Permissions.arcaneBypass(player)) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Arcane.Perfect");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Arcane.Perfect");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -322,7 +321,7 @@ public class RepairManager extends SkillManager {
|
||||
item.removeEnchantment(enchant);
|
||||
}
|
||||
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Lost");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Lost");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -347,11 +346,11 @@ public class RepairManager extends SkillManager {
|
||||
Map<Enchantment, Integer> newEnchants = item.getEnchantments();
|
||||
|
||||
if (newEnchants.isEmpty()) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Fail");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Fail");
|
||||
} else if (downgraded || newEnchants.size() < enchants.size()) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Downgrade");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Downgrade");
|
||||
} else {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Arcane.Perfect");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Arcane.Perfect");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
@ -49,7 +48,7 @@ public class SalvageManager extends SkillManager {
|
||||
}
|
||||
|
||||
if (mcMMO.getConfigManager().getConfigSalvage().getGeneral().isAnvilMessages()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Salvage.Listener.Anvil");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Salvage.Listener.Anvil");
|
||||
}
|
||||
|
||||
if (mcMMO.getConfigManager().getConfigSalvage().getGeneral().isAnvilPlacedSounds()) {
|
||||
@ -65,18 +64,18 @@ public class SalvageManager extends SkillManager {
|
||||
Salvageable salvageable = mcMMO.getSalvageableManager().getSalvageable(item.getType());
|
||||
|
||||
if (item.getItemMeta().isUnbreakable()) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Anvil.Unbreakable");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Anvil.Unbreakable");
|
||||
return;
|
||||
}
|
||||
|
||||
// Permissions checks on material and item types
|
||||
if (!Permissions.salvageItemType(player, salvageable.getSalvageItemType())) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Permissions.salvageMaterialType(player, salvageable.getSalvageItemMaterialCategory())) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -85,7 +84,7 @@ public class SalvageManager extends SkillManager {
|
||||
|
||||
// Level check
|
||||
if (!RankUtils.hasUnlockedSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE)) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Salvage.Skills.Adept.Level", String.valueOf(RankUtils.getUnlockLevel(SubSkillType.SALVAGE_ARCANE_SALVAGE)), StringUtils.getPrettyItemString(item.getType()));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Salvage.Skills.Adept.Level", String.valueOf(RankUtils.getUnlockLevel(SubSkillType.SALVAGE_ARCANE_SALVAGE)), StringUtils.getPrettyItemString(item.getType()));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -94,7 +93,7 @@ public class SalvageManager extends SkillManager {
|
||||
int salvageableAmount = maxAmountSalvageable;
|
||||
|
||||
if (salvageableAmount == 0) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.TooDamaged");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.TooDamaged");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -126,11 +125,11 @@ public class SalvageManager extends SkillManager {
|
||||
}
|
||||
|
||||
if(lotteryResults == salvageableAmount) {
|
||||
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Perfect", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Perfect", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
} else if(RankUtils.isPlayerMaxRankInSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE)) {
|
||||
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
} else {
|
||||
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
}
|
||||
|
||||
ItemStack salvageResults = new ItemStack(salvageable.getSalvagedItemMaterial(), lotteryResults);
|
||||
@ -153,7 +152,7 @@ public class SalvageManager extends SkillManager {
|
||||
//player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Salvage.Skills.Success");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Salvage.Skills.Success");
|
||||
}
|
||||
|
||||
/*public double getMaxSalvagePercentage() {
|
||||
@ -212,7 +211,7 @@ public class SalvageManager extends SkillManager {
|
||||
Player player = getPlayer();
|
||||
|
||||
if (!RankUtils.hasUnlockedSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE) || !Permissions.arcaneSalvage(player)) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcaneFailed");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcaneFailed");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -238,10 +237,10 @@ public class SalvageManager extends SkillManager {
|
||||
}
|
||||
|
||||
if (failedAllEnchants(arcaneFailureCount, enchants.entrySet().size())) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcaneFailed");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcaneFailed");
|
||||
return null;
|
||||
} else if (downgraded) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcanePartial");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcanePartial");
|
||||
}
|
||||
|
||||
book.setItemMeta(enchantMeta);
|
||||
@ -272,7 +271,7 @@ public class SalvageManager extends SkillManager {
|
||||
|
||||
actualizeLastAnvilUse();
|
||||
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Skills.ConfirmOrCancel", LocaleLoader.getString("Salvage.Pretty.Name"));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Skills.ConfirmOrCancel", LocaleLoader.getString("Salvage.Pretty.Name"));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -7,11 +7,11 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
@ -70,16 +70,16 @@ public class SwordsManager extends SkillManager {
|
||||
if (defender.isBlocking())
|
||||
return;
|
||||
|
||||
if (NotificationManager.doesPlayerUseNotifications(defender)) {
|
||||
if (mcMMO.getNotificationManager().doesPlayerUseNotifications(defender)) {
|
||||
if (!BleedTimerTask.isBleeding(defender))
|
||||
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding.Started");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding.Started");
|
||||
}
|
||||
}
|
||||
|
||||
BleedTimerTask.add(target, getPlayer(), getRuptureBleedTicks(), RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE), getToolTier(getPlayer().getInventory().getItemInMainHand()));
|
||||
|
||||
if (mcMMOPlayer.useChatNotifications()) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -125,10 +125,10 @@ public class SwordsManager extends SkillManager {
|
||||
if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_COUNTER_ATTACK, getPlayer())) {
|
||||
CombatUtils.dealDamage(attacker, damage / AdvancedConfig.getInstance().getCounterAttackModifier(), getPlayer());
|
||||
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Countered");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Countered");
|
||||
|
||||
if (attacker instanceof Player) {
|
||||
NotificationManager.sendPlayerInformation((Player) attacker, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Counter.Hit");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation((Player) attacker, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Counter.Hit");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||
@ -144,10 +143,10 @@ public class TamingManager extends SkillManager {
|
||||
BleedTimerTask.add(target, getPlayer(), Taming.getInstance().getGoreBleedTicks(), 1, 2);
|
||||
|
||||
if (target instanceof Player) {
|
||||
NotificationManager.sendPlayerInformation((Player) target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation((Player) target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore");
|
||||
}
|
||||
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.Gore");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.Gore");
|
||||
|
||||
damage = (damage * Taming.getInstance().getGoreModifier()) - damage;
|
||||
return damage;
|
||||
@ -226,7 +225,7 @@ public class TamingManager extends SkillManager {
|
||||
Player owner = getPlayer();
|
||||
|
||||
wolf.teleport(owner);
|
||||
NotificationManager.sendPlayerInformation(owner, NotificationType.SUBSKILL_MESSAGE, "Taming.Listener.Wolf");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(owner, NotificationType.SUBSKILL_MESSAGE, "Taming.Listener.Wolf");
|
||||
}
|
||||
|
||||
public void pummel(LivingEntity target, Wolf wolf) {
|
||||
@ -242,8 +241,8 @@ public class TamingManager extends SkillManager {
|
||||
if (target instanceof Player) {
|
||||
Player defender = (Player) target;
|
||||
|
||||
if (NotificationManager.doesPlayerUseNotifications(defender)) {
|
||||
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Taming.SubSkill.Pummel.TargetMessage");
|
||||
if (mcMMO.getNotificationManager().doesPlayerUseNotifications(defender)) {
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Taming.SubSkill.Pummel.TargetMessage");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -288,7 +287,7 @@ public class TamingManager extends SkillManager {
|
||||
|
||||
if (heldItemAmount < summonAmount) {
|
||||
int moreAmount = summonAmount - heldItemAmount;
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.NotEnough", String.valueOf(moreAmount), StringUtils.getPrettyItemString(heldItem.getType()));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.NotEnough", String.valueOf(moreAmount), StringUtils.getPrettyItemString(heldItem.getType()));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -361,7 +360,7 @@ public class TamingManager extends SkillManager {
|
||||
lifeSpan = LocaleLoader.getString("Taming.Summon.Lifespan", tamingCOTWLength);
|
||||
}
|
||||
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Taming.Summon.Complete", lifeSpan);
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Taming.Summon.Complete", lifeSpan);
|
||||
player.playSound(location, Sound.ENTITY_FIREWORK_ROCKET_BLAST_FAR, 1F, 0.5F);
|
||||
}
|
||||
|
||||
@ -375,7 +374,7 @@ public class TamingManager extends SkillManager {
|
||||
|
||||
for (Entity entity : player.getNearbyEntities(range, range, range)) {
|
||||
if (entity.getType() == type) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, Taming.getInstance().getCallOfTheWildFailureMessage(type));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, Taming.getInstance().getCallOfTheWildFailureMessage(type));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -396,7 +395,7 @@ public class TamingManager extends SkillManager {
|
||||
int summonAmount = trackedEntities == null ? 0 : trackedEntities.size();
|
||||
|
||||
if (summonAmount >= maxAmountSummons) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Taming.Summon.Fail.TooMany", String.valueOf(maxAmountSummons));
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Taming.Summon.Fail.TooMany", String.valueOf(maxAmountSummons));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -8,12 +8,12 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
@ -111,7 +111,7 @@ public class UnarmedManager extends SkillManager {
|
||||
}
|
||||
|
||||
defender.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
|
||||
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Skills.Disarmed");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Skills.Disarmed");
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ public class UnarmedManager extends SkillManager {
|
||||
*/
|
||||
public boolean deflectCheck() {
|
||||
if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.UNARMED_ARROW_DEFLECT, getPlayer())) {
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.ArrowDeflect");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.ArrowDeflect");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -172,8 +172,8 @@ public class UnarmedManager extends SkillManager {
|
||||
private boolean hasIronGrip(Player defender) {
|
||||
if (!Misc.isNPCEntity(defender) && Permissions.isSubSkillEnabled(defender, SubSkillType.UNARMED_IRON_GRIP)
|
||||
&& RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.UNARMED_IRON_GRIP, getPlayer())) {
|
||||
NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Unarmed.Ability.IronGrip.Defender");
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Unarmed.Ability.IronGrip.Attacker");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Unarmed.Ability.IronGrip.Defender");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Unarmed.Ability.IronGrip.Attacker");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod;
|
||||
import com.gmail.nossr50.util.*;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
@ -85,13 +85,13 @@ public class WoodcuttingManager extends SkillManager {
|
||||
if (Woodcutting.treeFellerReachedThreshold) {
|
||||
Woodcutting.treeFellerReachedThreshold = false;
|
||||
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Threshold");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Threshold");
|
||||
return;
|
||||
}
|
||||
|
||||
// If the tool can't sustain the durability loss
|
||||
if (!Woodcutting.handleDurabilityLoss(treeFellerBlocks, player.getInventory().getItemInMainHand())) {
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Splinter");
|
||||
mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Splinter");
|
||||
|
||||
double health = player.getHealth();
|
||||
|
||||
|
Reference in New Issue
Block a user