Skip to content

Commit

Permalink
remove unimplemented features, fix tests again, and optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nossr50 committed Mar 30, 2024
1 parent ef3887a commit bf901a0
Show file tree
Hide file tree
Showing 38 changed files with 73 additions and 231 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/gmail/nossr50/api/PartyAPI.java
Expand Up @@ -5,10 +5,8 @@
import com.gmail.nossr50.datatypes.party.PartyLeader;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.player.UserManager;
import jdk.jfr.Experimental;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
Expand Down
Expand Up @@ -11,7 +11,6 @@
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.text.StringUtils;
import org.bukkit.entity.Player;
Expand Down
Expand Up @@ -3,7 +3,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Expand Up @@ -3,7 +3,6 @@
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.OfflinePlayer;
Expand Down
Expand Up @@ -3,7 +3,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Expand Up @@ -5,7 +5,6 @@
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Expand Up @@ -6,7 +6,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
Expand Down
Expand Up @@ -4,7 +4,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
Expand Down
Expand Up @@ -4,7 +4,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
Expand Down
Expand Up @@ -4,7 +4,6 @@
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.OfflinePlayer;
Expand Down
Expand Up @@ -5,7 +5,6 @@
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Expand Up @@ -5,7 +5,6 @@
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Expand Up @@ -3,7 +3,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Expand Up @@ -5,7 +5,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
Expand Down
Expand Up @@ -4,7 +4,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Expand Up @@ -4,7 +4,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.Command;
Expand Down
Expand Up @@ -7,7 +7,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.runnables.items.TeleportationWarmup;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/gmail/nossr50/datatypes/party/Party.java
Expand Up @@ -6,7 +6,6 @@
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.sounds.SoundManager;
Expand Down
69 changes: 0 additions & 69 deletions src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java
Expand Up @@ -20,12 +20,9 @@
import com.gmail.nossr50.events.experience.McMMOPlayerPreXpGainEvent;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.runnables.skills.AbilityCooldownTask;
import com.gmail.nossr50.runnables.skills.AbilityDisableTask;
import com.gmail.nossr50.runnables.skills.ToolLowerTask;
import com.gmail.nossr50.skills.AlternateFiringSuperSkill;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
import com.gmail.nossr50.skills.alchemy.AlchemyManager;
Expand Down Expand Up @@ -964,72 +961,6 @@ public void checkAbilityActivation(PrimarySkillType primarySkillType) {
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(player, new AbilityDisableTask(this, superAbilityType), (long) ticks * Misc.TICK_CONVERSION_FACTOR);
}

public void checkCrossbowAbilityActivation() {
PrimarySkillType primarySkillType = PrimarySkillType.CROSSBOWS;
ToolType tool = ToolType.CROSSBOW;
SuperAbilityType superAbilityType = SuperAbilityType.SUPER_SHOTGUN;
SubSkillType subSkillType = SubSkillType.CROSSBOWS_SUPER_SHOTGUN;
AlternateFiringSuperSkill skillManager = getCrossbowsManager();

// Check permission
if (!superAbilityType.getPermissions(player)) {
return;
}

//TODO: This is hacky and temporary solution until skills are move to the new system
//Potential problems with this include skills with two super abilities (ie mining)
if(!RankUtils.hasUnlockedSubskill(player, subSkillType))
{
int diff = RankUtils.getSuperAbilityUnlockRequirement(superAbilityType) - getSkillLevel(primarySkillType);

//Inform the player they are not yet skilled enough
NotificationManager.sendPlayerInformation(player,
NotificationType.ABILITY_COOLDOWN,
"Skills.AbilityGateRequirementFail",
String.valueOf(diff),
mcMMO.p.getSkillTools().getLocalizedSkillName(primarySkillType));
return;
}

// Call the event
if (EventUtils.callPlayerAbilityActivateEvent(player, primarySkillType).isCancelled()) {
return;
}

// Check if we can fire the ability
if (!skillManager.isReadyToFire()) {
return;
}

if (useChatNotifications()) {
NotificationManager.sendPlayerInformation(player, NotificationType.SUPER_ABILITY, superAbilityType.getAbilityOn());
}

if (mcMMO.p.getAdvancedConfig().sendAbilityNotificationToOtherPlayers()) {
SkillUtils.sendSkillMessage(player, NotificationType.SUPER_ABILITY_ALERT_OTHERS, superAbilityType.getAbilityPlayer());
}

//Sounds
SoundManager.worldSendSound(player.getWorld(), player.getLocation(), SoundType.ABILITY_ACTIVATED_GENERIC);

// TODO: Fire the ability
profile.setAbilityDATS(superAbilityType, System.currentTimeMillis());
setToolPreparationMode(tool, false);
skillManager.resetCharge();
skillManager.fireSuper();

if(!mcMMO.isServerShutdownExecuted()) {
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(
player,
new AbilityCooldownTask(this, superAbilityType),
(long) PerksUtils.handleCooldownPerks(player, superAbilityType.getCooldown()) * Misc.TICK_CONVERSION_FACTOR);
}
}

public void chargeCrossbowSuper() {
getCrossbowsManager().chargeSuper();
}

public void processAbilityActivation(@NotNull PrimarySkillType primarySkillType) {
if (!mcMMO.p.getSkillTools().doesPlayerHaveSkillPermission(getPlayer(), primarySkillType)) {
return;
Expand Down
Expand Up @@ -22,7 +22,6 @@ public enum SubSkillType {
ARCHERY_DAZE,
ARCHERY_SKILL_SHOT(20),
ARCHERY_ARCHERY_LIMIT_BREAK(10),
ARCHERY_EXPLOSIVE_SHOT(1),

/* Axes */
AXES_ARMOR_IMPACT(20),
Expand All @@ -33,7 +32,6 @@ public enum SubSkillType {
AXES_SKULL_SPLITTER(1),

/* CROSSBOWS */
CROSSBOWS_SUPER_SHOTGUN(1),
CROSSBOWS_CROSSBOWS_LIMIT_BREAK(10),
CROSSBOWS_TRICK_SHOT(3),
CROSSBOWS_POWERED_SHOT(20),
Expand Down Expand Up @@ -101,7 +99,6 @@ public enum SubSkillType {
TAMING_THICK_FUR(1),

/* Tridents */
TRIDENTS_SUPER(1),
TRIDENTS_IMPALE(10),
TRIDENTS_TRIDENTS_LIMIT_BREAK(10),

Expand Down
Expand Up @@ -112,8 +112,6 @@ public enum SuperAbilityType {
TREE_FELLER.subSkillTypeDefinition = SubSkillType.WOODCUTTING_TREE_FELLER;
SERRATED_STRIKES.subSkillTypeDefinition = SubSkillType.SWORDS_SERRATED_STRIKES;
BLAST_MINING.subSkillTypeDefinition = SubSkillType.MINING_BLAST_MINING;
TRIDENTS_SUPER_ABILITY.subSkillTypeDefinition = SubSkillType.TRIDENTS_SUPER;
SUPER_SHOTGUN.subSkillTypeDefinition = SubSkillType.CROSSBOWS_SUPER_SHOTGUN;
}

private final String abilityOn;
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/com/gmail/nossr50/listeners/PlayerListener.java
Expand Up @@ -24,7 +24,6 @@
import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
import com.gmail.nossr50.util.sounds.SoundManager;
Expand Down Expand Up @@ -828,11 +827,6 @@ public void onPlayerInteractMonitor(PlayerInteractEvent event) {
mcMMOPlayer.processAbilityActivation(PrimarySkillType.HERBALISM);
}

// Projectile Skills
if (ItemUtils.isCrossbow(heldItem) || ItemUtils.isBow(heldItem)) {
CombatUtils.processProjectileSkillSuperAbilityActivation(mcMMOPlayer, heldItem);
}

mcMMOPlayer.processAbilityActivation(PrimarySkillType.AXES);
mcMMOPlayer.processAbilityActivation(PrimarySkillType.EXCAVATION);
mcMMOPlayer.processAbilityActivation(PrimarySkillType.MINING);
Expand Down Expand Up @@ -904,11 +898,6 @@ else if (herbalismManager.canUseShroomThumb(blockState)) {
mcMMOPlayer.processAbilityActivation(PrimarySkillType.SWORDS);
mcMMOPlayer.processAbilityActivation(PrimarySkillType.UNARMED);
mcMMOPlayer.processAbilityActivation(PrimarySkillType.WOODCUTTING);

// Projectile Skills
if (ItemUtils.isCrossbow(heldItem) || ItemUtils.isBow(heldItem)) {
CombatUtils.processProjectileSkillSuperAbilityActivation(mcMMOPlayer, heldItem);
}
}

/* ITEM CHECKS */
Expand All @@ -929,11 +918,6 @@ else if (herbalismManager.canUseShroomThumb(blockState)) {
break;
}

// Check charge up supers (crossbows, etc...)
if (ItemUtils.isCrossbow(heldItem)) {
mcMMOPlayer.chargeCrossbowSuper();
}

/* CALL OF THE WILD CHECKS */
Material type = heldItem.getType();
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
Expand Down

0 comments on commit bf901a0

Please sign in to comment.