Skip to content

Commit

Permalink
Merge pull request #15 from PixelOutlaw/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
UltraFaceguy authored Aug 17, 2020
2 parents 25c9245 + 69a5c3f commit 9d8f6a5
Show file tree
Hide file tree
Showing 97 changed files with 2,065 additions and 1,345 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
<parent>
<groupId>io.pixeloutlaw</groupId>
<artifactId>spigot-plugin-parent</artifactId>
<version>1.16.1.0</version>
<version>1.16.2.0</version>
</parent>

<artifactId>strife</artifactId>
<version>3.1.3</version>
<version>3.2.0</version>
<packaging>jar</packaging>

<name>strife</name>
Expand Down Expand Up @@ -81,7 +81,7 @@
<dependency>
<groupId>io.pixeloutlaw</groupId>
<artifactId>facecore</artifactId>
<version>1.16.1.8</version>
<version>1.16.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -93,7 +93,7 @@
<dependency>
<groupId>LibsDisguises</groupId>
<artifactId>LibsDisguises</artifactId>
<version>10.0.5-SNAPSHOT</version>
<version>10.0.15-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
81 changes: 52 additions & 29 deletions src/main/java/land/face/strife/StrifePlugin.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/**
* The MIT License Copyright (c) 2015 Teal Cube Games
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package land.face.strife;

Expand Down Expand Up @@ -44,6 +42,8 @@
import land.face.strife.commands.SpawnerCommand;
import land.face.strife.commands.StrifeCommand;
import land.face.strife.commands.UniqueEntityCommand;
import land.face.strife.data.LevelPath;
import land.face.strife.data.LevelPath.Path;
import land.face.strife.data.Spawner;
import land.face.strife.data.UniqueEntity;
import land.face.strife.data.ability.Ability;
Expand All @@ -66,7 +66,7 @@
import land.face.strife.listeners.EvokerFangEffectListener;
import land.face.strife.listeners.ExperienceListener;
import land.face.strife.listeners.FallListener;
import land.face.strife.listeners.HeadDropListener;
import land.face.strife.listeners.FishingListener;
import land.face.strife.listeners.HeadLoadListener;
import land.face.strife.listeners.HealingListener;
import land.face.strife.listeners.InventoryListener;
Expand Down Expand Up @@ -107,6 +107,7 @@
import land.face.strife.managers.MinionManager;
import land.face.strife.managers.MobModManager;
import land.face.strife.managers.MonsterManager;
import land.face.strife.managers.PathManager;
import land.face.strife.managers.RageManager;
import land.face.strife.managers.SkillExperienceManager;
import land.face.strife.managers.SoulManager;
Expand All @@ -122,6 +123,7 @@
import land.face.strife.menus.abilities.AbilityPickerPickerMenu;
import land.face.strife.menus.levelup.ConfirmationMenu;
import land.face.strife.menus.levelup.LevelupMenu;
import land.face.strife.menus.levelup.PathMenu;
import land.face.strife.menus.stats.StatsMenu;
import land.face.strife.stats.AbilitySlot;
import land.face.strife.stats.StrifeStat;
Expand Down Expand Up @@ -180,6 +182,7 @@ public class StrifePlugin extends FacePlugin {
private VersionedSmartYamlConfiguration equipmentYAML;
private VersionedSmartYamlConfiguration conditionYAML;
private VersionedSmartYamlConfiguration effectYAML;
private VersionedSmartYamlConfiguration pathYAML;
private VersionedSmartYamlConfiguration abilityYAML;
private VersionedSmartYamlConfiguration loreAbilityYAML;
private VersionedSmartYamlConfiguration buffsYAML;
Expand Down Expand Up @@ -215,6 +218,7 @@ public class StrifePlugin extends FacePlugin {
private LoreAbilityManager loreAbilityManager;
private AbilityIconManager abilityIconManager;
private BuffManager buffManager;
private PathManager pathManager;
private CombatStatusManager combatStatusManager;
private SpawnerManager spawnerManager;
private MobModManager mobModManager;
Expand All @@ -237,6 +241,7 @@ public class StrifePlugin extends FacePlugin {
private AbilityPickerPickerMenu abilitySubcategoryMenu;
private Map<String, AbilityPickerMenu> abilitySubmenus;
private LevelupMenu levelupMenu;
private Map<Path, PathMenu> pathMenus = new HashMap<>();
private ConfirmationMenu confirmMenu;
private StatsMenu statsMenu;

Expand Down Expand Up @@ -266,6 +271,7 @@ public void enable() {
configurations.add(conditionYAML = defaultSettingsLoad("conditions.yml"));
configurations.add(effectYAML = defaultSettingsLoad("effects.yml"));
configurations.add(abilityYAML = defaultSettingsLoad("abilities.yml"));
configurations.add(pathYAML = defaultSettingsLoad("paths.yml"));
configurations.add(loreAbilityYAML = defaultSettingsLoad("lore-abilities.yml"));
configurations.add(buffsYAML = defaultSettingsLoad("buffs.yml"));
configurations.add(modsYAML = defaultSettingsLoad("mob-mods.yml"));
Expand Down Expand Up @@ -318,6 +324,7 @@ public void enable() {
loreAbilityManager = new LoreAbilityManager(abilityManager, effectManager);
abilityIconManager = new AbilityIconManager(this);
buffManager = new BuffManager();
pathManager = new PathManager();
combatStatusManager = new CombatStatusManager(this);

MenuListener.getInstance().register(this);
Expand All @@ -341,6 +348,7 @@ public void enable() {
buildConditions();
buildEffects();
buildAbilities();
buildPaths();
buildLoreAbilities();

buildUniqueEnemies();
Expand Down Expand Up @@ -469,21 +477,17 @@ public void enable() {
agilityManager.loadAgilityContainers();
boostManager.loadBoosts();

Bukkit.getPluginManager().registerEvents(new EndermanListener(), this);
Bukkit.getPluginManager().registerEvents(new ExperienceListener(this), this);
Bukkit.getPluginManager().registerEvents(new HealingListener(), this);
Bukkit.getPluginManager().registerEvents(new CombatListener(this), this);
Bukkit.getPluginManager().registerEvents(new CreeperExplodeListener(this), this);
Bukkit.getPluginManager().registerEvents(
new UniqueSplashListener(strifeMobManager, blockManager, effectManager), this);
Bukkit.getPluginManager().registerEvents(
new EvokerFangEffectListener(strifeMobManager, effectManager), this);
Bukkit.getPluginManager().registerEvents(new UniqueSplashListener(this), this);
Bukkit.getPluginManager().registerEvents(new EvokerFangEffectListener(strifeMobManager, effectManager), this);
Bukkit.getPluginManager().registerEvents(new DOTListener(this), this);
Bukkit.getPluginManager().registerEvents(new EndermanListener(), this);
Bukkit.getPluginManager().registerEvents(new SwingListener(this), this);
Bukkit.getPluginManager().registerEvents(new ShootListener(this), this);
Bukkit.getPluginManager().registerEvents(new ChatListener(), this);
Bukkit.getPluginManager().registerEvents(new HeadDropListener(strifeMobManager), this);
Bukkit.getPluginManager().registerEvents(new MoveListener(), this);
Bukkit.getPluginManager().registerEvents(new DataListener(this), this);
Bukkit.getPluginManager().registerEvents(new DeathListener(this), this);
Expand All @@ -492,15 +496,14 @@ public void enable() {
Bukkit.getPluginManager().registerEvents(new EntityMagicListener(this), this);
Bukkit.getPluginManager().registerEvents(new SpawnListener(this), this);
Bukkit.getPluginManager().registerEvents(new MoneyDropListener(this), this);
Bukkit.getPluginManager().registerEvents(
new MinionListener(strifeMobManager, minionManager), this);
Bukkit.getPluginManager().registerEvents(new MinionListener(strifeMobManager, minionManager), this);
Bukkit.getPluginManager().registerEvents(new TargetingListener(this), this);
Bukkit.getPluginManager().registerEvents(new FallListener(this), this);
Bukkit.getPluginManager().registerEvents(new LaunchAndLandListener(this), this);
Bukkit.getPluginManager().registerEvents(new DoubleJumpListener(this), this);
Bukkit.getPluginManager().registerEvents(new FishingListener(this), this);
Bukkit.getPluginManager().registerEvents(new DogeListener(strifeMobManager), this);
Bukkit.getPluginManager()
.registerEvents(new LoreAbilityListener(strifeMobManager, loreAbilityManager), this);
Bukkit.getPluginManager().registerEvents(new LoreAbilityListener(strifeMobManager, loreAbilityManager), this);
Bukkit.getPluginManager().registerEvents(new InventoryListener(this), this);

if (Bukkit.getPluginManager().getPlugin("Bullion") != null) {
Expand Down Expand Up @@ -536,13 +539,16 @@ public void enable() {
levelupMenu = new LevelupMenu(this, getAttributeManager().getAttributes());
confirmMenu = new ConfirmationMenu(this);
statsMenu = new StatsMenu();
for (Path path : LevelPath.PATH_VALUES) {
pathMenus.put(path, new PathMenu(this, path));
}

for (Player player : Bukkit.getOnlinePlayers()) {
getChampionManager().updateAll(championManager.getChampion(player));
statUpdateManager.updateAttributes(player);
statUpdateManager.updateVanillaAttributes(player);
abilityManager.loadPlayerCooldowns(player);
abilityIconManager.setAllAbilityIcons(player);
}
getChampionManager().updateAll();

DamageUtil.refresh();

Expand Down Expand Up @@ -602,6 +608,16 @@ private void buildAbilities() {
}
}

private void buildPaths() {
for (String key : pathYAML.getKeys(false)) {
if (!pathYAML.isConfigurationSection(key)) {
continue;
}
ConfigurationSection cs = pathYAML.getConfigurationSection(key);
pathManager.loadPath(key, cs);
}
}

private void buildEffects() {
LogUtil.printDebug("Starting effect load!");
for (String key : effectYAML.getKeys(false)) {
Expand Down Expand Up @@ -717,7 +733,6 @@ private void buildUniqueEnemies() {
uniqueEntity.setBonusExperience(cs.getInt("bonus-experience", 0));
uniqueEntity.setDisplaceMultiplier(cs.getDouble("displace-multiplier", 1.0));
uniqueEntity.setExperienceMultiplier((float) cs.getDouble("experience-multiplier", 1));
uniqueEntity.setKnockbackImmune(cs.getBoolean("knockback-immune", false));
uniqueEntity.setCharmImmune(cs.getBoolean("charm-immune", false));
uniqueEntity.setBurnImmune(cs.getBoolean("burn-immune", false));
uniqueEntity.setFallImmune(cs.getBoolean("fall-immune", false));
Expand Down Expand Up @@ -964,6 +979,10 @@ public BuffManager getBuffManager() {
return buffManager;
}

public PathManager getPathManager() {
return pathManager;
}

public MobModManager getMobModManager() {
return mobModManager;
}
Expand Down Expand Up @@ -1024,6 +1043,10 @@ public StatsMenu getStatsMenu() {
return statsMenu;
}

public PathMenu getPathMenu(Path path) {
return pathMenus.get(path);
}

public EnergyRegenTask getEnergyRegenTask() {
return energyRegenTask;
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/land/face/strife/commands/InspectCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import com.tealcube.minecraft.bukkit.facecore.utilities.MessageUtils;
import land.face.strife.StrifePlugin;
import land.face.strife.data.champion.Champion;
import org.bukkit.entity.Player;
import se.ranzdo.bukkit.methodcommand.Arg;
import se.ranzdo.bukkit.methodcommand.Command;
Expand All @@ -35,9 +34,8 @@ public InspectCommand(StrifePlugin plugin) {

@Command(identifier = "stats", permissions = "strife.command.stats")
public void baseCommand(Player sender) {
Champion champion = plugin.getChampionManager().getChampion(sender);
plugin.getChampionManager().updateAll(champion);
plugin.getStatUpdateManager().updateAttributes(sender);
plugin.getChampionManager().update(sender);
plugin.getStatUpdateManager().updateVanillaAttributes(sender);
plugin.getStatsMenu().setTargetPlayer(sender);
plugin.getStatsMenu().open(sender);
}
Expand Down
21 changes: 14 additions & 7 deletions src/main/java/land/face/strife/commands/StrifeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public void defeatCommand(CommandSender sender, @Arg(name = "winner") Player win
.replace("{1}", String.valueOf(Math.round(loseDiff))));
}

@Command(identifier = "strife resetcooldown", permissions = "strife.command.strife.defeat", onlyPlayers = false)
public void defeatCommand(CommandSender sender, @Arg(name = "target") Player target) {
target.resetCooldown();
}

@Command(identifier = "strife reload", permissions = "strife.command.strife.reload", onlyPlayers = false)
public void reloadCommand(CommandSender sender) {
// Save player data before reload continues
Expand All @@ -114,7 +119,7 @@ public void reloadCommand(CommandSender sender) {
plugin.enable();

for (Player player : Bukkit.getOnlinePlayers()) {
plugin.getStatUpdateManager().updateAttributes(player);
plugin.getStatUpdateManager().updateVanillaAttributes(player);
}

sendMessage(sender,
Expand Down Expand Up @@ -158,12 +163,14 @@ public void resetCommand(CommandSender sender, @Arg(name = "target") Player targ
}
champion.setHighestReachedLevel(target.getLevel());
champion.setUnusedStatPoints(target.getLevel());
champion.getSaveData().getPathMap().clear();
plugin.getPathManager().buildPathBonus(champion);
sendMessage(sender, "<green>You reset <white>%player%<green>.",
new String[][]{{"%player%", target.getDisplayName()}});
sendMessage(target, "<green>Your stats have been reset.");
sendMessage(target, "&6You have unspent levelpoints! Use &f/levelup &6to spend them!");
plugin.getChampionManager().updateAll(champion);
plugin.getStatUpdateManager().updateAttributes(champion.getPlayer());
plugin.getChampionManager().update(target);
plugin.getStatUpdateManager().updateVanillaAttributes(champion.getPlayer());
}

@Command(identifier = "strife clear", permissions = "strife.command.strife.clear", onlyPlayers = false)
Expand All @@ -179,8 +186,8 @@ public void clearCommand(CommandSender sender, @Arg(name = "target") Player targ
sendMessage(sender, "<green>You cleared <white>%player%<green>.",
new String[][]{{"%player%", target.getDisplayName()}});
sendMessage(target, "<green>Your stats have been cleared.");
plugin.getChampionManager().updateAll(champion);
plugin.getStatUpdateManager().updateAttributes(champion.getPlayer());
plugin.getChampionManager().update(target);
plugin.getStatUpdateManager().updateVanillaAttributes(champion.getPlayer());
}

@Command(identifier = "strife raise", permissions = "strife.command.strife.raise", onlyPlayers = false)
Expand All @@ -193,11 +200,11 @@ public void raiseCommand(CommandSender sender, @Arg(name = "target") Player targ
target.setExp(0f);
target.setLevel(newLevel);
Champion champion = plugin.getChampionManager().getChampion(target);
plugin.getChampionManager().updateAll(champion);
plugin.getChampionManager().update(target);
sendMessage(sender, "<green>You raised <white>%player%<green> to level <white>%level%<green>.",
new String[][]{{"%player%", target.getDisplayName()}, {"%level%", "" + newLevel}});
sendMessage(target, "<green>Your level has been raised.");
plugin.getStatUpdateManager().updateAttributes(champion.getPlayer());
plugin.getStatUpdateManager().updateVanillaAttributes(champion.getPlayer());
}

@Command(identifier = "strife ability set", permissions = "strife.command.strife.binding", onlyPlayers = false)
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/land/face/strife/data/BlockData.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package land.face.strife.data;

import com.gmail.filoghost.holographicdisplays.api.Hologram;
import java.util.HashSet;
import java.util.Set;

public class BlockData {

private long lastHit;
private double storedBlock;
private int runes;
private final Set<Hologram> runeHolograms = new HashSet<>();

public BlockData(long lastHit, double storedBlock) {
this.lastHit = lastHit;
Expand Down Expand Up @@ -35,4 +40,8 @@ public int getRunes() {
public void setRunes(int runes) {
this.runes = runes;
}

public Set<Hologram> getRuneHolograms() {
return runeHolograms;
}
}
3 changes: 1 addition & 2 deletions src/main/java/land/face/strife/data/BonusDamage.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ public class BonusDamage {
private final StrifeStat damageStat;
private final float amount;

public BonusDamage(DamageScale damageScale, DamageType damageType,
StrifeStat damageStat, float amount) {
public BonusDamage(DamageScale damageScale, DamageType damageType, StrifeStat damageStat, float amount) {
this.damageScale = damageScale;
this.damageType = damageType;
this.damageStat = damageStat;
Expand Down
Loading

0 comments on commit 9d8f6a5

Please sign in to comment.