mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 08:25:07 +00:00
Port water abilities to new configuration system & slightly improve the new system
This commit is contained in:
parent
d21086a1bc
commit
185c432eca
72 changed files with 1259 additions and 521 deletions
|
@ -1438,10 +1438,10 @@ public class GeneralMethods {
|
||||||
isHarmless = coreAbil.isHarmlessAbility();
|
isHarmless = coreAbil.isHarmlessAbility();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ability == null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_AllowHarmlessAbilities) {
|
if (ability == null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.AllowHarmlessAbilities) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isHarmless && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_AllowHarmlessAbilities) {
|
if (isHarmless && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.AllowHarmlessAbilities) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1459,7 +1459,7 @@ public class GeneralMethods {
|
||||||
for (final Location location : new Location[] { loc, player.getLocation() }) {
|
for (final Location location : new Location[] { loc, player.getLocation() }) {
|
||||||
final World world = location.getWorld();
|
final World world = location.getWorld();
|
||||||
|
|
||||||
if (lwc != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectLWC) {
|
if (lwc != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectLWC) {
|
||||||
final LWCPlugin lwcp = (LWCPlugin) lwc;
|
final LWCPlugin lwcp = (LWCPlugin) lwc;
|
||||||
final LWC lwc2 = lwcp.getLWC();
|
final LWC lwc2 = lwcp.getLWC();
|
||||||
final Protection protection = lwc2.getProtectionCache().getProtection(location.getBlock());
|
final Protection protection = lwc2.getProtectionCache().getProtection(location.getBlock());
|
||||||
|
@ -1469,7 +1469,7 @@ public class GeneralMethods {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wgp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectWorldGuard && !player.hasPermission("worldguard.region.bypass." + world.getName())) {
|
if (wgp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectWorldGuard && !player.hasPermission("worldguard.region.bypass." + world.getName())) {
|
||||||
final WorldGuard wg = WorldGuard.getInstance();
|
final WorldGuard wg = WorldGuard.getInstance();
|
||||||
if (!player.isOnline()) {
|
if (!player.isOnline()) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1507,7 +1507,7 @@ public class GeneralMethods {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (facsfw != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectFactions) {
|
if (facsfw != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectFactions) {
|
||||||
final FPlayer fPlayer = FPlayers.getBySender(player);
|
final FPlayer fPlayer = FPlayers.getBySender(player);
|
||||||
final Faction faction = Factions.getFactionAt(location);
|
final Faction faction = Factions.getFactionAt(location);
|
||||||
final Rel relation = fPlayer.getRelationTo(faction);
|
final Rel relation = fPlayer.getRelationTo(faction);
|
||||||
|
@ -1517,7 +1517,7 @@ public class GeneralMethods {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (twnp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectTowny) {
|
if (twnp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectTowny) {
|
||||||
final Towny twn = (Towny) twnp;
|
final Towny twn = (Towny) twnp;
|
||||||
|
|
||||||
WorldCoord worldCoord;
|
WorldCoord worldCoord;
|
||||||
|
@ -1553,7 +1553,7 @@ public class GeneralMethods {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gpp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectGriefPrevention) {
|
if (gpp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectGriefPrevention) {
|
||||||
Material type = player.getWorld().getBlockAt(location).getType();
|
Material type = player.getWorld().getBlockAt(location).getType();
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
type = Material.AIR;
|
type = Material.AIR;
|
||||||
|
@ -1567,18 +1567,18 @@ public class GeneralMethods {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (residence != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectResidence) {
|
if (residence != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectResidence) {
|
||||||
final ResidenceInterface res = Residence.getInstance().getResidenceManagerAPI();
|
final ResidenceInterface res = Residence.getInstance().getResidenceManagerAPI();
|
||||||
final ClaimedResidence claim = res.getByLoc(location);
|
final ClaimedResidence claim = res.getByLoc(location);
|
||||||
if (claim != null) {
|
if (claim != null) {
|
||||||
final ResidencePermissions perms = claim.getPermissions();
|
final ResidencePermissions perms = claim.getPermissions();
|
||||||
if (!perms.hasApplicableFlag(player.getName(), ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_ResidenceFlag)) {
|
if (!perms.hasApplicableFlag(player.getName(), ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.ResidenceFlag)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kingdoms != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectKingdoms) {
|
if (kingdoms != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectKingdoms) {
|
||||||
final KingdomPlayer kPlayer = GameManagement.getPlayerManager().getOfflineKingdomPlayer(player).getKingdomPlayer();
|
final KingdomPlayer kPlayer = GameManagement.getPlayerManager().getOfflineKingdomPlayer(player).getKingdomPlayer();
|
||||||
if (kPlayer.getKingdom() != null) {
|
if (kPlayer.getKingdom() != null) {
|
||||||
final SimpleChunkLocation chunkLocation = new SimpleChunkLocation(location.getChunk());
|
final SimpleChunkLocation chunkLocation = new SimpleChunkLocation(location.getChunk());
|
||||||
|
@ -1593,7 +1593,7 @@ public class GeneralMethods {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redprotect != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectRedProtect) {
|
if (redprotect != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectRedProtect) {
|
||||||
final RedProtectAPI api = RedProtect.get().getAPI();
|
final RedProtectAPI api = RedProtect.get().getAPI();
|
||||||
final Region region = api.getRegion(location);
|
final Region region = api.getRegion(location);
|
||||||
if (!(region != null && region.canBuild(player))) {
|
if (!(region != null && region.canBuild(player))) {
|
||||||
|
@ -1875,28 +1875,28 @@ public class GeneralMethods {
|
||||||
final Plugin kingdoms = pm.getPlugin("Kingdoms");
|
final Plugin kingdoms = pm.getPlugin("Kingdoms");
|
||||||
final Plugin redprotect = pm.getPlugin("RedProtect");
|
final Plugin redprotect = pm.getPlugin("RedProtect");
|
||||||
|
|
||||||
if (wgp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectWorldGuard) {
|
if (wgp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectWorldGuard) {
|
||||||
writeToDebug("WorldGuard v" + wgp.getDescription().getVersion());
|
writeToDebug("WorldGuard v" + wgp.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
if (fcp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectFactions) {
|
if (fcp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectFactions) {
|
||||||
writeToDebug("FactionsFramework v" + fcp.getDescription().getVersion());
|
writeToDebug("FactionsFramework v" + fcp.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
if (twnp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectTowny) {
|
if (twnp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectTowny) {
|
||||||
writeToDebug("Towny v" + twnp.getDescription().getVersion());
|
writeToDebug("Towny v" + twnp.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
if (gpp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectGriefPrevention) {
|
if (gpp != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectGriefPrevention) {
|
||||||
writeToDebug("GriefPrevention v" + gpp.getDescription().getVersion());
|
writeToDebug("GriefPrevention v" + gpp.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
if (lwc != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectLWC) {
|
if (lwc != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectLWC) {
|
||||||
writeToDebug("LWC v" + lwc.getDescription().getVersion());
|
writeToDebug("LWC v" + lwc.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
if (residence != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectResidence) {
|
if (residence != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectResidence) {
|
||||||
writeToDebug("Residence v" + residence.getDescription().getVersion());
|
writeToDebug("Residence v" + residence.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
if (kingdoms != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectKingdoms) {
|
if (kingdoms != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectKingdoms) {
|
||||||
writeToDebug("Kingdoms v" + kingdoms.getDescription().getVersion());
|
writeToDebug("Kingdoms v" + kingdoms.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
if (redprotect != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection_RespectRedProtect) {
|
if (redprotect != null && ConfigManager.getConfig(GeneralPropertiesConfig.class).RegionProtection.RespectRedProtect) {
|
||||||
writeToDebug("RedProtect v" + redprotect.getDescription().getVersion());
|
writeToDebug("RedProtect v" + redprotect.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,11 +141,11 @@ public class ProjectKorra extends JavaPlugin {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Bukkit.getPluginManager().getPlugin("Residence") != null) {
|
if (Bukkit.getPluginManager().getPlugin("Residence") != null) {
|
||||||
FlagPermissions.addFlag(GENERAL_PROPERTIES.RegionProtection_ResidenceFlag);
|
FlagPermissions.addFlag(GENERAL_PROPERTIES.RegionProtection.ResidenceFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralMethods.deserializeFile();
|
GeneralMethods.deserializeFile();
|
||||||
GeneralMethods.startCacheCleaner(GENERAL_PROPERTIES.RegionProtection_CacheBlockTime);
|
GeneralMethods.startCacheCleaner(GENERAL_PROPERTIES.RegionProtection.CacheBlockTime);
|
||||||
|
|
||||||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||||
new PlaceholderAPIHook(this).register();
|
new PlaceholderAPIHook(this).register();
|
||||||
|
|
|
@ -5,16 +5,11 @@ import java.util.ArrayList;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
public interface ComboAbility {
|
public interface ComboAbility<C extends AbilityConfig> {
|
||||||
|
|
||||||
/**
|
public abstract Object createNewComboInstance(C config, Player player);
|
||||||
* Accessor Method to get the instructions for using this combo.
|
|
||||||
*
|
|
||||||
* @return The steps for the combo.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public abstract Object createNewComboInstance(Player player);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of abilities which constitute the combo.
|
* Returns the list of abilities which constitute the combo.
|
||||||
|
|
|
@ -19,7 +19,6 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.util.Collision;
|
import com.projectkorra.projectkorra.ability.util.Collision;
|
||||||
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.SourcedWaterAbilityConfig;
|
|
||||||
import com.projectkorra.projectkorra.configuration.better.configs.properties.WaterPropertiesConfig;
|
import com.projectkorra.projectkorra.configuration.better.configs.properties.WaterPropertiesConfig;
|
||||||
import com.projectkorra.projectkorra.firebending.HeatControl;
|
import com.projectkorra.projectkorra.firebending.HeatControl;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
|
@ -38,22 +37,6 @@ public abstract class WaterAbility<C extends AbilityConfig> extends ElementalAbi
|
||||||
super(config, player);
|
super(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canAutoSource() {
|
|
||||||
if (config instanceof SourcedWaterAbilityConfig) {
|
|
||||||
return ((SourcedWaterAbilityConfig) config).CanAutoSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canDynamicSource() {
|
|
||||||
if (config instanceof SourcedWaterAbilityConfig) {
|
|
||||||
return ((SourcedWaterAbilityConfig) config).CanDynamicSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Element getElement() {
|
public Element getElement() {
|
||||||
return Element.WATER;
|
return Element.WATER;
|
||||||
|
|
|
@ -15,11 +15,10 @@ import com.projectkorra.projectkorra.ability.ComboAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
|
||||||
import com.projectkorra.projectkorra.configuration.better.configs.abilities.air.AirStreamConfig;
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.air.AirStreamConfig;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
|
|
||||||
public class AirStream extends AirAbility<AirStreamConfig> implements ComboAbility {
|
public class AirStream extends AirAbility<AirStreamConfig> implements ComboAbility<AirStreamConfig> {
|
||||||
|
|
||||||
@Attribute(Attribute.COOLDOWN)
|
@Attribute(Attribute.COOLDOWN)
|
||||||
private long cooldown;
|
private long cooldown;
|
||||||
|
@ -201,8 +200,8 @@ public class AirStream extends AirAbility<AirStreamConfig> implements ComboAbili
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object createNewComboInstance(final Player player) {
|
public Object createNewComboInstance(final AirStreamConfig config, final Player player) {
|
||||||
return new AirStream(ConfigManager.getConfig(AirStreamConfig.class), player);
|
return new AirStream(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -18,13 +18,12 @@ import com.projectkorra.projectkorra.ability.util.Collision;
|
||||||
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
|
||||||
import com.projectkorra.projectkorra.configuration.better.configs.abilities.air.AirSweepConfig;
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.air.AirSweepConfig;
|
||||||
import com.projectkorra.projectkorra.firebending.combo.FireComboStream;
|
import com.projectkorra.projectkorra.firebending.combo.FireComboStream;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
|
|
||||||
public class AirSweep extends AirAbility<AirSweepConfig> implements ComboAbility {
|
public class AirSweep extends AirAbility<AirSweepConfig> implements ComboAbility<AirSweepConfig> {
|
||||||
|
|
||||||
private int progressCounter;
|
private int progressCounter;
|
||||||
@Attribute(Attribute.COOLDOWN)
|
@Attribute(Attribute.COOLDOWN)
|
||||||
|
@ -243,8 +242,8 @@ public class AirSweep extends AirAbility<AirSweepConfig> implements ComboAbility
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object createNewComboInstance(final Player player) {
|
public Object createNewComboInstance(final AirSweepConfig config, final Player player) {
|
||||||
return new AirSweep(ConfigManager.getConfig(AirSweepConfig.class), player);
|
return new AirSweep(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,11 +14,10 @@ import com.projectkorra.projectkorra.ability.ComboAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
|
||||||
import com.projectkorra.projectkorra.configuration.better.configs.abilities.air.TwisterConfig;
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.air.TwisterConfig;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
|
|
||||||
public class Twister extends AirAbility<TwisterConfig> implements ComboAbility {
|
public class Twister extends AirAbility<TwisterConfig> implements ComboAbility<TwisterConfig> {
|
||||||
|
|
||||||
public static enum AbilityState {
|
public static enum AbilityState {
|
||||||
TWISTER_MOVING, TWISTER_STATIONARY
|
TWISTER_MOVING, TWISTER_STATIONARY
|
||||||
|
@ -181,8 +180,8 @@ public class Twister extends AirAbility<TwisterConfig> implements ComboAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object createNewComboInstance(final Player player) {
|
public Object createNewComboInstance(final TwisterConfig config, final Player player) {
|
||||||
return new Twister(ConfigManager.getConfig(TwisterConfig.class), player);
|
return new Twister(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,12 +15,11 @@ import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
|
||||||
import com.projectkorra.projectkorra.configuration.better.configs.abilities.chi.ImmobilizeConfig;
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.chi.ImmobilizeConfig;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
import com.projectkorra.projectkorra.util.MovementHandler;
|
import com.projectkorra.projectkorra.util.MovementHandler;
|
||||||
|
|
||||||
public class Immobilize extends ChiAbility<ImmobilizeConfig> implements ComboAbility {
|
public class Immobilize extends ChiAbility<ImmobilizeConfig> implements ComboAbility<ImmobilizeConfig> {
|
||||||
|
|
||||||
@Attribute(Attribute.DURATION)
|
@Attribute(Attribute.DURATION)
|
||||||
private long duration;
|
private long duration;
|
||||||
|
@ -90,8 +89,8 @@ public class Immobilize extends ChiAbility<ImmobilizeConfig> implements ComboAbi
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object createNewComboInstance(final Player player) {
|
public Object createNewComboInstance(final ImmobilizeConfig config, final Player player) {
|
||||||
return new Immobilize(ConfigManager.getConfig(ImmobilizeConfig.class), player);
|
return new Immobilize(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -50,34 +50,37 @@ public class ConfigManager {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
C defaultConfig = clazz.newInstance();
|
C defaultConfig = clazz.newInstance();
|
||||||
CONFIG_CACHE.put(clazz, defaultConfig);
|
|
||||||
|
|
||||||
File file = new File(JavaPlugin.getPlugin(ProjectKorra.class).getDataFolder(), "config");
|
if (defaultConfig.getName() != null && defaultConfig.getParents() != null) {
|
||||||
file.mkdirs();
|
CONFIG_CACHE.put(clazz, defaultConfig);
|
||||||
|
|
||||||
for (String parent : defaultConfig.getParents()) {
|
File file = new File(JavaPlugin.getPlugin(ProjectKorra.class).getDataFolder(), "config");
|
||||||
file = new File(file, parent);
|
file.mkdirs();
|
||||||
file.mkdir();
|
|
||||||
}
|
for (String parent : defaultConfig.getParents()) {
|
||||||
|
file = new File(file, parent);
|
||||||
file = new File(file, defaultConfig.getName() + ".json");
|
file.mkdir();
|
||||||
|
|
||||||
if (file.exists()) {
|
|
||||||
try {
|
|
||||||
C config = loadConfig(file, clazz);
|
|
||||||
|
|
||||||
CONFIG_CACHE.put(clazz, config);
|
|
||||||
return config;
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
return defaultConfig;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
try {
|
file = new File(file, defaultConfig.getName() + ".json");
|
||||||
saveConfig(file, defaultConfig);
|
|
||||||
} catch (IOException e) {
|
if (file.exists()) {
|
||||||
e.printStackTrace();
|
try {
|
||||||
|
C config = loadConfig(file, clazz);
|
||||||
|
|
||||||
|
CONFIG_CACHE.put(clazz, config);
|
||||||
|
return config;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
return defaultConfig;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
saveConfig(file, defaultConfig);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities;
|
||||||
|
|
||||||
|
public class EmptyAbilityConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public EmptyAbilityConfig() {
|
||||||
|
super(true, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ public class AirAgilityConfig extends AbilityConfig {
|
||||||
public final int SpeedPower = 0;
|
public final int SpeedPower = 0;
|
||||||
|
|
||||||
public AirAgilityConfig() {
|
public AirAgilityConfig() {
|
||||||
super(true, "", "");
|
super(true, "", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,7 +7,7 @@ public class AirSaturationConfig extends AbilityConfig {
|
||||||
public final double ExhaustionFactor = 0;
|
public final double ExhaustionFactor = 0;
|
||||||
|
|
||||||
public AirSaturationConfig() {
|
public AirSaturationConfig() {
|
||||||
super(true, "", "");
|
super(true, "", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class AirShieldConfig extends AbilityConfig {
|
public class AirShieldConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final double MaxRadius = 0;
|
public final double MaxRadius = 0;
|
||||||
public final double InitialRadius = 0;
|
public final double InitialRadius = 0;
|
||||||
public final long Duration = 0;
|
public final long Duration = 0;
|
||||||
|
@ -11,7 +12,6 @@ public class AirShieldConfig extends AbilityConfig {
|
||||||
public final int Streams = 0;
|
public final int Streams = 0;
|
||||||
public final int AnimationParticleAmount = 0;
|
public final int AnimationParticleAmount = 0;
|
||||||
public final boolean DynamicCooldown = true;
|
public final boolean DynamicCooldown = true;
|
||||||
public final long Cooldown = 0;
|
|
||||||
|
|
||||||
public final boolean AvatarState_Toggle = true;
|
public final boolean AvatarState_Toggle = true;
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class AirSpoutConfig extends AbilityConfig {
|
public class AirSpoutConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final long Duration = 0;
|
public final long Duration = 0;
|
||||||
public final long Interval = 0;
|
public final long Interval = 0;
|
||||||
public final double Height = 0;
|
public final double Height = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
|
|
||||||
public final double AvatarState_Height = 0;
|
public final double AvatarState_Height = 0;
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class AirStreamConfig extends AbilityConfig {
|
public class AirStreamConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final double Range = 0;
|
public final double Range = 0;
|
||||||
public final double Speed = 0;
|
public final double Speed = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
|
|
||||||
public final double EntityCarryHeight = 0;
|
public final double EntityCarryHeight = 0;
|
||||||
public final long EntityCarryDuration = 0;
|
public final long EntityCarryDuration = 0;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class AirSuctionConfig extends AbilityConfig {
|
public class AirSuctionConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final int AnimationParticleAmount = 0;
|
public final int AnimationParticleAmount = 0;
|
||||||
public final int SelectionParticleAmount = 0;
|
public final int SelectionParticleAmount = 0;
|
||||||
public final double PushFactor = 0;
|
public final double PushFactor = 0;
|
||||||
|
@ -11,7 +12,6 @@ public class AirSuctionConfig extends AbilityConfig {
|
||||||
public final double Range = 0;
|
public final double Range = 0;
|
||||||
public final double SelectionRange = 0;
|
public final double SelectionRange = 0;
|
||||||
public final double Radius = 0;
|
public final double Radius = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
|
|
||||||
public final double AvatarState_PushFactor = 0;
|
public final double AvatarState_PushFactor = 0;
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class AirSweepConfig extends AbilityConfig {
|
public class AirSweepConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final double Damage = 0;
|
public final double Damage = 0;
|
||||||
public final double Range = 0;
|
public final double Range = 0;
|
||||||
public final double Speed = 0;
|
public final double Speed = 0;
|
||||||
public final double Knockback = 0;
|
public final double Knockback = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
|
|
||||||
public final double AvatarState_Damage = 0;
|
public final double AvatarState_Damage = 0;
|
||||||
public final double AvatarState_Range = 0;
|
public final double AvatarState_Range = 0;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class AirSwipeConfig extends AbilityConfig {
|
public class AirSwipeConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final int AnimationParticleAmount = 0;
|
public final int AnimationParticleAmount = 0;
|
||||||
public final int Arc = 0;
|
public final int Arc = 0;
|
||||||
public final int StepSize = 0;
|
public final int StepSize = 0;
|
||||||
|
@ -14,7 +15,6 @@ public class AirSwipeConfig extends AbilityConfig {
|
||||||
public final double Range = 0;
|
public final double Range = 0;
|
||||||
public final double Radius = 0;
|
public final double Radius = 0;
|
||||||
public final double MaxChargeFactor = 0;
|
public final double MaxChargeFactor = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
|
|
||||||
public final long AvatarState_Cooldown = 0;
|
public final long AvatarState_Cooldown = 0;
|
||||||
public final double AvatarState_Damage = 0;
|
public final double AvatarState_Damage = 0;
|
||||||
|
|
|
@ -4,8 +4,8 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class FlightConfig extends AbilityConfig {
|
public class FlightConfig extends AbilityConfig {
|
||||||
|
|
||||||
public final long Duration = 0;
|
|
||||||
public final long Cooldown = 0;
|
public final long Cooldown = 0;
|
||||||
|
public final long Duration = 0;
|
||||||
public final double BaseSpeed = 0;
|
public final double BaseSpeed = 0;
|
||||||
|
|
||||||
public FlightConfig() {
|
public FlightConfig() {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
public class GracefulDescentConfig extends AbilityConfig {
|
public class GracefulDescentConfig extends AbilityConfig {
|
||||||
|
|
||||||
public GracefulDescentConfig() {
|
public GracefulDescentConfig() {
|
||||||
super(true, "", "");
|
super(true, "", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class SuffocateConfig extends AbilityConfig {
|
public class SuffocateConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final boolean RequireConstantAim = true;
|
public final boolean RequireConstantAim = true;
|
||||||
public final double ConstantAimRadius = 0;
|
public final double ConstantAimRadius = 0;
|
||||||
public final boolean CanSuffocateUndead = false;
|
public final boolean CanSuffocateUndead = false;
|
||||||
|
@ -12,7 +13,6 @@ public class SuffocateConfig extends AbilityConfig {
|
||||||
public final long ChargeTime = 0;
|
public final long ChargeTime = 0;
|
||||||
public final double Range = 0;
|
public final double Range = 0;
|
||||||
public final double AnimationRadius = 0;
|
public final double AnimationRadius = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
public final double Damage = 0;
|
public final double Damage = 0;
|
||||||
public final double DamageInitialDelay = 0;
|
public final double DamageInitialDelay = 0;
|
||||||
public final double DamageInterval = 0;
|
public final double DamageInterval = 0;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class TornadoConfig extends AbilityConfig {
|
public class TornadoConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final long Duration = 0;
|
public final long Duration = 0;
|
||||||
public final double Range = 0;
|
public final double Range = 0;
|
||||||
public final double Height = 0;
|
public final double Height = 0;
|
||||||
|
@ -11,7 +12,6 @@ public class TornadoConfig extends AbilityConfig {
|
||||||
public final double NpcPushFactor = 0;
|
public final double NpcPushFactor = 0;
|
||||||
public final double Radius = 0;
|
public final double Radius = 0;
|
||||||
public final double Speed = 0;
|
public final double Speed = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
|
|
||||||
public TornadoConfig() {
|
public TornadoConfig() {
|
||||||
super(true, "", "");
|
super(true, "", "");
|
||||||
|
|
|
@ -4,9 +4,9 @@ import com.projectkorra.projectkorra.configuration.better.configs.abilities.Abil
|
||||||
|
|
||||||
public class TwisterConfig extends AbilityConfig {
|
public class TwisterConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final double Range = 0;
|
public final double Range = 0;
|
||||||
public final double Speed = 0;
|
public final double Speed = 0;
|
||||||
public final long Cooldown = 0;
|
|
||||||
public final double Height = 0;
|
public final double Height = 0;
|
||||||
public final double Radius = 0;
|
public final double Radius = 0;
|
||||||
public final double DegreesPerParticle = 0;
|
public final double DegreesPerParticle = 0;
|
||||||
|
|
|
@ -7,7 +7,7 @@ public class AcrobaticsConfig extends AbilityConfig {
|
||||||
public final double FallReductionFactor = 0;
|
public final double FallReductionFactor = 0;
|
||||||
|
|
||||||
public AcrobaticsConfig() {
|
public AcrobaticsConfig() {
|
||||||
super(true, "", "");
|
super(true, "", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class ChiAgilityConfig extends AbilityConfig {
|
||||||
public final int SpeedPower = 0;
|
public final int SpeedPower = 0;
|
||||||
|
|
||||||
public ChiAgilityConfig() {
|
public ChiAgilityConfig() {
|
||||||
super(true, "", "");
|
super(true, "", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,7 +7,7 @@ public class ChiSaturationConfig extends AbilityConfig {
|
||||||
public final double ExhaustionFactor = 0;
|
public final double ExhaustionFactor = 0;
|
||||||
|
|
||||||
public ChiSaturationConfig() {
|
public ChiSaturationConfig() {
|
||||||
super(true, "", "");
|
super(true, "", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class BloodbendingConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Duration = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double Knockback = 0;
|
||||||
|
|
||||||
|
public final boolean CanOnlyBeUsedAtNight = true;
|
||||||
|
public final boolean CanBeUsedOnUndeadMobs = false;
|
||||||
|
public final boolean CanOnlyBeUsedDuringFullMoon = true;
|
||||||
|
public final boolean CanBloodbendOtherBloodbenders = false;
|
||||||
|
|
||||||
|
public BloodbendingConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "Bloodbending";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class FastSwimConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Duration = 0;
|
||||||
|
public final double SpeedFactor = 0;
|
||||||
|
|
||||||
|
public FastSwimConfig() {
|
||||||
|
super(true, "", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "FastSwim";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water", "Passives" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class HealingWatersConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Duration = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
public final long ChargeTime = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final int PotionPotency = 0;
|
||||||
|
public final boolean EnableParticles = true;
|
||||||
|
|
||||||
|
public HealingWatersConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "HealingWaters";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class HydroSinkConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public HydroSinkConfig() {
|
||||||
|
super(true, "", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "HydroSink";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water", "Passives" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class IceBlastConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
public final double CollisionRadius = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final double DeflectRange = 0;
|
||||||
|
public final boolean AllowSnow = true;
|
||||||
|
|
||||||
|
public final long AvatarState_Cooldown = 0;
|
||||||
|
public final double AvatarState_Damage = 0;
|
||||||
|
public final double AvatarState_Range = 0;
|
||||||
|
|
||||||
|
public IceBlastConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "IceBlast";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class IceBulletConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long ShotCooldown = 0;
|
||||||
|
public final long ShootTime = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final int MaxShots = 0;
|
||||||
|
public final double AnimationSpeed = 0;
|
||||||
|
|
||||||
|
public final long AvatarState_Cooldown = 0;
|
||||||
|
|
||||||
|
public IceBulletConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "IceBullet";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water", "Combos" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class IceSpikeConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;//
|
||||||
|
public final int Height = 0;//
|
||||||
|
public final double Damage = 0;//
|
||||||
|
public final double Range = 0;//
|
||||||
|
public final double Speed = 0;//
|
||||||
|
public final double Push = 0;//
|
||||||
|
|
||||||
|
public final long SlowCooldown = 0;
|
||||||
|
public final int SlowPower = 0;
|
||||||
|
public final int SlowDuration = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Damage = 0;
|
||||||
|
public final double AvatarState_Range = 0;
|
||||||
|
public final int AvatarState_Height = 0;
|
||||||
|
public final double AvatarState_Push = 0;
|
||||||
|
|
||||||
|
public final int AvatarState_SlowPower = 0;
|
||||||
|
public final int AvatarState_SlowDuration = 0;
|
||||||
|
|
||||||
|
public final BlastConfig BlastConfig = new BlastConfig();
|
||||||
|
|
||||||
|
public final FieldConfig FieldConfig = new FieldConfig();
|
||||||
|
|
||||||
|
public static class BlastConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double CollisionRadius = 0;
|
||||||
|
public final double DeflectRange = 0;
|
||||||
|
|
||||||
|
public final double ProjectileRange = 0;
|
||||||
|
|
||||||
|
public final long SlowCooldown = 0;
|
||||||
|
public final int SlowPotency = 0;
|
||||||
|
public final int SlowDuration = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Damage = 0;
|
||||||
|
public final double AvatarState_Range = 0;
|
||||||
|
|
||||||
|
public final int AvatarState_SlowPotency = 0;
|
||||||
|
public final int AvatarState_SlowDuration = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class FieldConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double Knockup = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Damage = 0;
|
||||||
|
public final double AvatarState_Radius = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public IceSpikeConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "IceSpike";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class IceWaveConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
|
||||||
|
public final double ThawRadius = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final boolean RevertSphere = true;
|
||||||
|
public final long RevertSphereTime = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Damage = 0;
|
||||||
|
|
||||||
|
public IceWaveConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "IceWave";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water", "Combos" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class OctopusFormConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Duration = 0;
|
||||||
|
public final long FormDelay = 0;
|
||||||
|
public final double SelectionRange = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final double AttackRange = 0;
|
||||||
|
public final long UsageCooldown = 0;
|
||||||
|
public final double Knockback = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double AngleIncrement = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Damage = 0;
|
||||||
|
public final double AvatarState_AttackRange = 0;
|
||||||
|
public final double AvatarState_Knockback = 0;
|
||||||
|
public final double AvatarState_Radius = 0;
|
||||||
|
|
||||||
|
public OctopusFormConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "OctopusForm";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class PhaseChangeConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final double SourceRange = 0;
|
||||||
|
|
||||||
|
public final FreezeConfig FreezeConfig = new FreezeConfig();
|
||||||
|
|
||||||
|
public final MeltConfig MeltConfig = new MeltConfig();
|
||||||
|
|
||||||
|
public static class FreezeConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final int Depth = 0;
|
||||||
|
public final double ControlRadius = 0;
|
||||||
|
public final int Radius = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class MeltConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final double Speed = 0;
|
||||||
|
public final int Radius = 0;
|
||||||
|
public final boolean AllowFlow = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public PhaseChangeConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "PhaseChange";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class SurgeConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final SurgeWaveConfig WaveConfig = new SurgeWaveConfig();
|
||||||
|
|
||||||
|
public final SurgeWallConfig WallConfig = new SurgeWallConfig();
|
||||||
|
|
||||||
|
public static class SurgeWaveConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double Knockback = 0;
|
||||||
|
public final double Knockup = 0;
|
||||||
|
public final double MaxFreezeRadius = 0;
|
||||||
|
public final long IceRevertTime = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double SelectRange = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Radius = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class SurgeWallConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
public final long Duration = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Radius = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public SurgeConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "Surge";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class TorrentConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final int MaxLayer = 0;
|
||||||
|
public final double Knockback = 0;
|
||||||
|
public final double Angle = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double Knockup = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
public final double InitialDamage = 0;
|
||||||
|
public final double SuccessiveDamage = 0;
|
||||||
|
public final int MaxHits = 0;
|
||||||
|
public final double DeflectDamage = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double SelectRange = 0;
|
||||||
|
|
||||||
|
public final boolean Revert = true;
|
||||||
|
public final long RevertTime = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Knockback = 0;
|
||||||
|
public final double AvatarState_InitialDamage = 0;
|
||||||
|
public final double AvatarState_SuccessiveDamage = 0;
|
||||||
|
public final int AvatarState_MaxHits = 0;
|
||||||
|
|
||||||
|
public final TorrentWaveConfig WaveConfig = new TorrentWaveConfig();
|
||||||
|
|
||||||
|
public static class TorrentWaveConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
public final double Height = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double Knockback = 0;
|
||||||
|
public final double GrowSpeed = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public TorrentConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "Torrent";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,106 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class WaterArmsConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final int InitialLength = 0;
|
||||||
|
public final double SourceGrabRange = 0;
|
||||||
|
public final boolean AllowPlantSource = true;
|
||||||
|
public final int MaxAttacks = 0;
|
||||||
|
public final int MaxIceShots = 0;
|
||||||
|
public final int MaxAlternateUsage = 0;
|
||||||
|
|
||||||
|
public final boolean LightningVulnerability = true;
|
||||||
|
public final boolean LightningInstaKill = true;
|
||||||
|
public final double LightningDamage = 0;
|
||||||
|
|
||||||
|
public final String SneakMessage = "";
|
||||||
|
|
||||||
|
public final FreezeConfig FreezeConfig = new FreezeConfig();
|
||||||
|
|
||||||
|
public final SpearConfig SpearConfig = new SpearConfig();
|
||||||
|
|
||||||
|
public final WhipConfig WhipConfig = new WhipConfig();
|
||||||
|
|
||||||
|
public static class FreezeConfig {
|
||||||
|
|
||||||
|
public final long UsageCooldown = 0;
|
||||||
|
public final boolean UsageCooldownEnabled = true;
|
||||||
|
|
||||||
|
public final int Range = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class SpearConfig {
|
||||||
|
|
||||||
|
public final long UsageCooldown = 0;
|
||||||
|
public final boolean UsageCooldownEnabled = true;
|
||||||
|
|
||||||
|
public final int Length = 0;
|
||||||
|
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final boolean DamageEnabled = true;
|
||||||
|
|
||||||
|
public final int RangeDay = 0;
|
||||||
|
public final int RangeNight = 0;
|
||||||
|
public final int RangeFullMoon = 0;
|
||||||
|
|
||||||
|
public final int SphereRadiusDay = 0;
|
||||||
|
public final int SphereRadiusNight = 0;
|
||||||
|
public final int SphereRadiusFullMoon = 0;
|
||||||
|
|
||||||
|
public final long DurationDay = 0;
|
||||||
|
public final long DurationNight = 0;
|
||||||
|
public final long DurationFullMoon = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class WhipConfig {
|
||||||
|
|
||||||
|
public final boolean UsageCooldownEnabled = true;
|
||||||
|
|
||||||
|
public final int MaxLengthDay = 0;
|
||||||
|
public final int MaxLengthWeak = 0;
|
||||||
|
public final int MaxLengthNight = 0;
|
||||||
|
public final int MaxLengthFullMoon = 0;
|
||||||
|
|
||||||
|
public final long UsageCooldownPunch = 0;
|
||||||
|
|
||||||
|
public final int PunchLengthDay = 0;
|
||||||
|
public final int PunchLengthNight = 0;
|
||||||
|
public final int PunchLengthFullMoon = 0;
|
||||||
|
|
||||||
|
public final double PunchDamage = 0;
|
||||||
|
|
||||||
|
public final long UsageCooldownGrab = 0;
|
||||||
|
|
||||||
|
public final long GrabDuration = 0;
|
||||||
|
|
||||||
|
public final long UsageCooldownPull = 0;
|
||||||
|
|
||||||
|
public final double PullFactor = 0;
|
||||||
|
|
||||||
|
public final long UsageCooldownGrapple = 0;
|
||||||
|
|
||||||
|
public final boolean GrappleRespectRegions = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public WaterArmsConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "WaterArms";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class WaterBubbleConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long ClickDuration = 0;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double Speed = 0;
|
||||||
|
public final boolean MustStartAboveWater = true;
|
||||||
|
|
||||||
|
public WaterBubbleConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "WaterBubble";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,11 +1,22 @@
|
||||||
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
public class WaterManipulationConfig extends SourcedWaterAbilityConfig {
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class WaterManipulationConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
public final double SelectRange = 0;
|
public final double SelectRange = 0;
|
||||||
|
public final double CollisionRadius = 0;
|
||||||
|
public final double Range = 0;
|
||||||
|
public final double Knockback = 0;
|
||||||
|
public final double Damage = 0;
|
||||||
|
public final double Speed = 0;
|
||||||
|
public final double DeflectRange = 0;
|
||||||
|
|
||||||
|
public final double AvatarState_Damage = 0;
|
||||||
|
|
||||||
public WaterManipulationConfig() {
|
public WaterManipulationConfig() {
|
||||||
super(true, "", "", true, true);
|
super(true, "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.projectkorra.projectkorra.configuration.better.configs.abilities.water;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig;
|
||||||
|
|
||||||
|
public class WaterSpoutConfig extends AbilityConfig {
|
||||||
|
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final boolean UseParticles = true;
|
||||||
|
public final boolean EnableBlockSpiral = true;
|
||||||
|
public final double Height = 0;
|
||||||
|
public final long Duration = 0;
|
||||||
|
public final long Interval = 0;
|
||||||
|
|
||||||
|
public final WaterSpoutWaveConfig WaveConfig = new WaterSpoutWaveConfig();
|
||||||
|
|
||||||
|
public static class WaterSpoutWaveConfig {
|
||||||
|
|
||||||
|
public final boolean Enabled = true;
|
||||||
|
public final long Cooldown = 0;
|
||||||
|
public final boolean AllowPlantSource = true;
|
||||||
|
public final double Radius = 0;
|
||||||
|
public final double WaveRadius = 0;
|
||||||
|
public final double AnimationSpeed = 0;
|
||||||
|
public final double SelectRange = 0;
|
||||||
|
public final double Speed = 0;
|
||||||
|
public final long ChargeTime = 0;
|
||||||
|
public final long FlightDuration = 0;
|
||||||
|
|
||||||
|
public final long AvatarState_FlightDuration = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public WaterSpoutConfig() {
|
||||||
|
super(true, "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "WaterSpout";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParents() {
|
||||||
|
return new String[] { "Abilities", "Water" };
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,28 +6,13 @@ public class GeneralPropertiesConfig implements Config {
|
||||||
|
|
||||||
public final boolean UpdateChecker = true;
|
public final boolean UpdateChecker = true;
|
||||||
|
|
||||||
public final double RegionProtection_CacheBlockTime = 0;
|
public final RegionProtectionConfig RegionProtection = new RegionProtectionConfig();
|
||||||
public final boolean RegionProtection_RespectResidence = true;
|
|
||||||
public final String RegionProtection_ResidenceFlag = "";
|
|
||||||
public final boolean RegionProtection_AllowHarmlessAbilities = true;
|
|
||||||
public final boolean RegionProtection_RespectWorldGuard = true;
|
|
||||||
public final boolean RegionProtection_RespectFactions = true;
|
|
||||||
public final boolean RegionProtection_RespectTowny = true;
|
|
||||||
public final boolean RegionProtection_RespectGriefPrevention = true;
|
|
||||||
public final boolean RegionProtection_RespectLWC = true;
|
|
||||||
public final boolean RegionProtection_RespectKingdoms = true;
|
|
||||||
public final boolean RegionProtection_RespectRedProtect = true;
|
|
||||||
|
|
||||||
public final boolean Statistics = true;
|
public final boolean Statistics = true;
|
||||||
|
|
||||||
public final boolean DatabaseCooldowns = true;
|
public final boolean DatabaseCooldowns = true;
|
||||||
|
|
||||||
public final boolean UseMySQL = false;
|
public final MySQLConfig MySQL = new MySQLConfig();
|
||||||
public final String MySQL_Host = "";
|
|
||||||
public final int MySQL_Port = 3306;
|
|
||||||
public final String MySQL_User = "";
|
|
||||||
public final String MySQL_Password = "";
|
|
||||||
public final String MySQL_Database = "";
|
|
||||||
|
|
||||||
public final boolean BendingPreview = true;
|
public final boolean BendingPreview = true;
|
||||||
|
|
||||||
|
@ -51,6 +36,43 @@ public class GeneralPropertiesConfig implements Config {
|
||||||
|
|
||||||
public final String[] DisabledWorlds = {};
|
public final String[] DisabledWorlds = {};
|
||||||
|
|
||||||
|
public static final class RegionProtectionConfig {
|
||||||
|
|
||||||
|
public final double CacheBlockTime = 0;
|
||||||
|
|
||||||
|
public final boolean RespectResidence = true;
|
||||||
|
public final String ResidenceFlag = "";
|
||||||
|
|
||||||
|
public final boolean AllowHarmlessAbilities = true;
|
||||||
|
|
||||||
|
public final boolean RespectWorldGuard = true;
|
||||||
|
|
||||||
|
public final boolean RespectFactions = true;
|
||||||
|
|
||||||
|
public final boolean RespectTowny = true;
|
||||||
|
|
||||||
|
public final boolean RespectGriefPrevention = true;
|
||||||
|
|
||||||
|
public final boolean RespectLWC = true;
|
||||||
|
|
||||||
|
public final boolean RespectKingdoms = true;
|
||||||
|
|
||||||
|
public final boolean RespectRedProtect = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final class MySQLConfig {
|
||||||
|
|
||||||
|
public final boolean Enabled = false;
|
||||||
|
|
||||||
|
public final String Host = "";
|
||||||
|
public final int Port = 3306;
|
||||||
|
public final String Username = "";
|
||||||
|
public final String Password = "";
|
||||||
|
public final String Database = "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "General";
|
return "General";
|
||||||
|
|
|
@ -18,6 +18,8 @@ public class WaterPropertiesConfig implements Config {
|
||||||
|
|
||||||
public final double MaxSelectRange = 0;
|
public final double MaxSelectRange = 0;
|
||||||
|
|
||||||
|
public final long PlantRegrowTime = 0;
|
||||||
|
|
||||||
public final boolean PlaySound = true;
|
public final boolean PlaySound = true;
|
||||||
public final Sound SoundType = Sound.BLOCK_WATER_AMBIENT;
|
public final Sound SoundType = Sound.BLOCK_WATER_AMBIENT;
|
||||||
public final float SoundVolume = 0;
|
public final float SoundVolume = 0;
|
||||||
|
@ -25,6 +27,9 @@ public class WaterPropertiesConfig implements Config {
|
||||||
|
|
||||||
public final Material[] IceBlocks = {};
|
public final Material[] IceBlocks = {};
|
||||||
|
|
||||||
|
public final boolean FreezePlayerHead = true;
|
||||||
|
public final boolean FreezePlayerFeet = true;
|
||||||
|
|
||||||
public final Sound IceSoundType = Sound.ITEM_FLINTANDSTEEL_USE;
|
public final Sound IceSoundType = Sound.ITEM_FLINTANDSTEEL_USE;
|
||||||
public final float IceSoundVolume = 0;
|
public final float IceSoundVolume = 0;
|
||||||
public final float IceSoundPitch = 0;
|
public final float IceSoundPitch = 0;
|
||||||
|
|
|
@ -21,12 +21,12 @@ public class DBConnection {
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
GeneralPropertiesConfig config = ConfigManager.getConfig(GeneralPropertiesConfig.class);
|
GeneralPropertiesConfig config = ConfigManager.getConfig(GeneralPropertiesConfig.class);
|
||||||
DBConnection.host = config.MySQL_Host;
|
DBConnection.host = config.MySQL.Host;
|
||||||
DBConnection.port = config.MySQL_Port;
|
DBConnection.port = config.MySQL.Port;
|
||||||
DBConnection.pass = config.MySQL_Password;
|
DBConnection.pass = config.MySQL.Password;
|
||||||
DBConnection.db = config.MySQL_Database;
|
DBConnection.db = config.MySQL.Database;
|
||||||
DBConnection.user = config.MySQL_User;
|
DBConnection.user = config.MySQL.Username;
|
||||||
if (config.UseMySQL) {
|
if (config.MySQL.Enabled) {
|
||||||
sql = new MySQL(ProjectKorra.log, "Establishing MySQL Connection...", host, port, user, pass, db);
|
sql = new MySQL(ProjectKorra.log, "Establishing MySQL Connection...", host, port, user, pass, db);
|
||||||
if (((MySQL) sql).open() == null) {
|
if (((MySQL) sql).open() == null) {
|
||||||
ProjectKorra.log.severe("Disabling due to database error");
|
ProjectKorra.log.severe("Disabling due to database error");
|
||||||
|
|
|
@ -19,6 +19,9 @@ import com.projectkorra.projectkorra.ability.AirAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.OctopusFormConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.PhaseChangeConfig;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
|
@ -29,16 +32,17 @@ import com.projectkorra.projectkorra.waterbending.ice.PhaseChange.PhaseChangeTyp
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class OctopusForm extends WaterAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class OctopusForm extends WaterAbility<OctopusFormConfig> {
|
||||||
|
|
||||||
private boolean sourceSelected;
|
private boolean sourceSelected;
|
||||||
private boolean settingUp;
|
private boolean settingUp;
|
||||||
private boolean forming;
|
private boolean forming;
|
||||||
private boolean formed;
|
private boolean formed;
|
||||||
@Attribute(Attribute.RANGE)
|
@Attribute(Attribute.RANGE)
|
||||||
private int range;
|
private double range;
|
||||||
@Attribute(Attribute.DAMAGE)
|
@Attribute(Attribute.DAMAGE)
|
||||||
private int damage;
|
private double damage;
|
||||||
private int currentAnimationStep;
|
private int currentAnimationStep;
|
||||||
private int stepCounter;
|
private int stepCounter;
|
||||||
private int totalStepCount;
|
private int totalStepCount;
|
||||||
|
@ -68,8 +72,8 @@ public class OctopusForm extends WaterAbility {
|
||||||
private ArrayList<TempBlock> newBlocks;
|
private ArrayList<TempBlock> newBlocks;
|
||||||
private PhaseChange pc;
|
private PhaseChange pc;
|
||||||
|
|
||||||
public OctopusForm(final Player player) {
|
public OctopusForm(final OctopusFormConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
final OctopusForm oldOctopus = getAbility(player, OctopusForm.class);
|
final OctopusForm oldOctopus = getAbility(player, OctopusForm.class);
|
||||||
if (oldOctopus != null) {
|
if (oldOctopus != null) {
|
||||||
|
@ -95,30 +99,30 @@ public class OctopusForm extends WaterAbility {
|
||||||
this.currentAnimationStep = 1;
|
this.currentAnimationStep = 1;
|
||||||
this.stepCounter = 1;
|
this.stepCounter = 1;
|
||||||
this.totalStepCount = 3;
|
this.totalStepCount = 3;
|
||||||
this.range = getConfig().getInt("Abilities.Water.OctopusForm.Range");
|
this.range = config.SelectionRange;
|
||||||
this.damage = getConfig().getInt("Abilities.Water.OctopusForm.Damage");
|
this.damage = config.Damage;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.OctopusForm.FormDelay");
|
this.interval = config.FormDelay;
|
||||||
this.attackRange = getConfig().getInt("Abilities.Water.OctopusForm.AttackRange");
|
this.attackRange = config.AttackRange;
|
||||||
this.usageCooldown = getConfig().getInt("Abilities.Water.OctopusForm.UsageCooldown");
|
this.usageCooldown = config.UsageCooldown;
|
||||||
this.knockback = getConfig().getDouble("Abilities.Water.OctopusForm.Knockback");
|
this.knockback = config.Knockback;
|
||||||
this.radius = getConfig().getDouble("Abilities.Water.OctopusForm.Radius");
|
this.radius = config.Radius;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.OctopusForm.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.duration = getConfig().getLong("Abilities.Water.OctopusForm.Duration");
|
this.duration = config.Duration;
|
||||||
this.angleIncrement = getConfig().getDouble("Abilities.Water.OctopusForm.AngleIncrement");
|
this.angleIncrement = config.AngleIncrement;
|
||||||
this.currentFormHeight = 0;
|
this.currentFormHeight = 0;
|
||||||
this.blocks = new ArrayList<TempBlock>();
|
this.blocks = new ArrayList<TempBlock>();
|
||||||
this.newBlocks = new ArrayList<TempBlock>();
|
this.newBlocks = new ArrayList<TempBlock>();
|
||||||
if (hasAbility(player, PhaseChange.class)) {
|
if (hasAbility(player, PhaseChange.class)) {
|
||||||
this.pc = getAbility(player, PhaseChange.class);
|
this.pc = getAbility(player, PhaseChange.class);
|
||||||
} else {
|
} else {
|
||||||
this.pc = new PhaseChange(player, PhaseChangeType.CUSTOM);
|
this.pc = new PhaseChange(ConfigManager.getConfig(PhaseChangeConfig.class), player, PhaseChangeType.CUSTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.damage = getConfig().getInt("Abilities.Avatar.AvatarState.Water.OctopusForm.Damage");
|
this.damage = config.AvatarState_Damage;
|
||||||
this.attackRange = getConfig().getInt("Abilities.Avatar.AvatarState.Water.OctopusForm.AttackRange");
|
this.attackRange = config.AvatarState_AttackRange;
|
||||||
this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.OctopusForm.Knockback");
|
this.knockback = config.AvatarState_Knockback;
|
||||||
this.radius = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.OctopusForm.Radius");
|
this.radius = config.AvatarState_Radius;
|
||||||
}
|
}
|
||||||
this.time = System.currentTimeMillis();
|
this.time = System.currentTimeMillis();
|
||||||
this.startTime = System.currentTimeMillis();
|
this.startTime = System.currentTimeMillis();
|
||||||
|
@ -146,7 +150,7 @@ public class OctopusForm extends WaterAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void form(final Player player) {
|
public static void form(final OctopusFormConfig config, final Player player) {
|
||||||
final OctopusForm oldForm = getAbility(player, OctopusForm.class);
|
final OctopusForm oldForm = getAbility(player, OctopusForm.class);
|
||||||
|
|
||||||
if (oldForm != null) {
|
if (oldForm != null) {
|
||||||
|
@ -158,7 +162,7 @@ public class OctopusForm extends WaterAbility {
|
||||||
if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) {
|
if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) {
|
||||||
block.setType(Material.WATER);
|
block.setType(Material.WATER);
|
||||||
block.setBlockData(GeneralMethods.getWaterData(0));
|
block.setBlockData(GeneralMethods.getWaterData(0));
|
||||||
final OctopusForm form = new OctopusForm(player);
|
final OctopusForm form = new OctopusForm(config, player);
|
||||||
form.setSourceBlock(block);
|
form.setSourceBlock(block);
|
||||||
form.form();
|
form.form();
|
||||||
|
|
||||||
|
@ -564,19 +568,19 @@ public class OctopusForm extends WaterAbility {
|
||||||
this.formed = formed;
|
this.formed = formed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRange() {
|
public double getRange() {
|
||||||
return this.range;
|
return this.range;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRange(final int range) {
|
public void setRange(final double range) {
|
||||||
this.range = range;
|
this.range = range;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDamage() {
|
public double getDamage() {
|
||||||
return this.damage;
|
return this.damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDamage(final int damage) {
|
public void setDamage(final double damage) {
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.SurgeConfig;
|
||||||
import com.projectkorra.projectkorra.firebending.FireBlast;
|
import com.projectkorra.projectkorra.firebending.FireBlast;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
|
@ -27,9 +28,9 @@ import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class SurgeWall extends WaterAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class SurgeWall extends WaterAbility<SurgeConfig> {
|
||||||
|
|
||||||
private static final String RANGE_CONFIG = "Abilities.Water.Surge.Wall.Range";
|
|
||||||
private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<>();
|
private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<>();
|
||||||
private static final Map<Block, Player> WALL_BLOCKS = new ConcurrentHashMap<>();
|
private static final Map<Block, Player> WALL_BLOCKS = new ConcurrentHashMap<>();
|
||||||
public static final List<TempBlock> SOURCE_BLOCKS = new ArrayList<>();
|
public static final List<TempBlock> SOURCE_BLOCKS = new ArrayList<>();
|
||||||
|
@ -57,14 +58,14 @@ public class SurgeWall extends WaterAbility {
|
||||||
private Vector targetDirection;
|
private Vector targetDirection;
|
||||||
private Map<Block, Material> oldTemps;
|
private Map<Block, Material> oldTemps;
|
||||||
|
|
||||||
public SurgeWall(final Player player) {
|
public SurgeWall(final SurgeConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.interval = getConfig().getLong("Abilities.Water.Surge.Wall.Interval");
|
this.interval = config.WallConfig.Interval;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.Surge.Wall.Cooldown");
|
this.cooldown = config.WallConfig.Cooldown;
|
||||||
this.duration = getConfig().getLong("Abilities.Water.Surge.Wall.Duration");
|
this.duration = config.WallConfig.Duration;
|
||||||
this.range = getConfig().getDouble(RANGE_CONFIG);
|
this.range = config.WallConfig.Range;
|
||||||
this.radius = getConfig().getDouble("Abilities.Water.Surge.Wall.Radius");
|
this.radius = config.WallConfig.Radius;
|
||||||
this.locations = new ArrayList<>();
|
this.locations = new ArrayList<>();
|
||||||
this.oldTemps = new HashMap<>();
|
this.oldTemps = new HashMap<>();
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ public class SurgeWall extends WaterAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.radius = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Surge.Wall.Radius");
|
this.radius = config.WallConfig.AvatarState_Radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
final SurgeWall wall = getAbility(player, SurgeWall.class);
|
final SurgeWall wall = getAbility(player, SurgeWall.class);
|
||||||
|
@ -104,7 +105,7 @@ public class SurgeWall extends WaterAbility {
|
||||||
final TempBlock tempBlock = new TempBlock(block, Material.WATER, GeneralMethods.getWaterData(0));
|
final TempBlock tempBlock = new TempBlock(block, Material.WATER, GeneralMethods.getWaterData(0));
|
||||||
SOURCE_BLOCKS.add(tempBlock);
|
SOURCE_BLOCKS.add(tempBlock);
|
||||||
|
|
||||||
wave = new SurgeWave(player);
|
wave = new SurgeWave(config, player);
|
||||||
wave.setCanHitSelf(false);
|
wave.setCanHitSelf(false);
|
||||||
wave.moveWater();
|
wave.moveWater();
|
||||||
|
|
||||||
|
@ -411,20 +412,19 @@ public class SurgeWall extends WaterAbility {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void form(final Player player) {
|
public static void form(final SurgeConfig config, final Player player) {
|
||||||
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||||
if (bPlayer == null) {
|
if (bPlayer == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int range = getConfig().getInt(RANGE_CONFIG);
|
|
||||||
SurgeWall wall = getAbility(player, SurgeWall.class);
|
SurgeWall wall = getAbility(player, SurgeWall.class);
|
||||||
SurgeWave wave = getAbility(player, SurgeWave.class);
|
SurgeWave wave = getAbility(player, SurgeWave.class);
|
||||||
|
|
||||||
if (wave != null) {
|
if (wave != null) {
|
||||||
if (wave.isProgressing() && !wave.isFreezing()) {
|
if (wave.isProgressing() && !wave.isFreezing()) {
|
||||||
// Freeze the wave.
|
// Freeze the wave.
|
||||||
new SurgeWave(player);
|
new SurgeWave(config, player);
|
||||||
} else if (wave.isActivateFreeze()) {
|
} else if (wave.isActivateFreeze()) {
|
||||||
wave.remove();
|
wave.remove();
|
||||||
return;
|
return;
|
||||||
|
@ -432,7 +432,7 @@ public class SurgeWall extends WaterAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wall == null) {
|
if (wall == null) {
|
||||||
final Block source = BlockSource.getWaterSourceBlock(player, range, ClickType.SHIFT_DOWN, true, true, bPlayer.canPlantbend());
|
final Block source = BlockSource.getWaterSourceBlock(player, config.WallConfig.Range, ClickType.SHIFT_DOWN, true, true, bPlayer.canPlantbend());
|
||||||
|
|
||||||
if (wave == null && source == null && WaterReturn.hasWaterBottle(player)) {
|
if (wave == null && source == null && WaterReturn.hasWaterBottle(player)) {
|
||||||
if (bPlayer.isOnCooldown("SurgeWall")) {
|
if (bPlayer.isOnCooldown("SurgeWall")) {
|
||||||
|
@ -446,7 +446,7 @@ public class SurgeWall extends WaterAbility {
|
||||||
final TempBlock tempBlock = new TempBlock(block, Material.WATER, GeneralMethods.getWaterData(0));
|
final TempBlock tempBlock = new TempBlock(block, Material.WATER, GeneralMethods.getWaterData(0));
|
||||||
SOURCE_BLOCKS.add(tempBlock);
|
SOURCE_BLOCKS.add(tempBlock);
|
||||||
|
|
||||||
wall = new SurgeWall(player);
|
wall = new SurgeWall(config, player);
|
||||||
wall.moveWater();
|
wall.moveWater();
|
||||||
|
|
||||||
if (!wall.progressing) {
|
if (!wall.progressing) {
|
||||||
|
@ -465,12 +465,12 @@ public class SurgeWall extends WaterAbility {
|
||||||
|
|
||||||
// If SurgeWall isn't being created, then try to source SurgeWave.
|
// If SurgeWall isn't being created, then try to source SurgeWave.
|
||||||
if (!bPlayer.isOnCooldown("SurgeWave")) {
|
if (!bPlayer.isOnCooldown("SurgeWave")) {
|
||||||
wave = new SurgeWave(player);
|
wave = new SurgeWave(config, player);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (isWaterbendable(player, null, player.getTargetBlock((HashSet<Material>) null, range))) {
|
if (isWaterbendable(player, null, player.getTargetBlock((HashSet<Material>) null, (int) config.WallConfig.Range))) {
|
||||||
wave = new SurgeWave(player);
|
wave = new SurgeWave(config, player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,9 @@ import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.SurgeConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.properties.WaterPropertiesConfig;
|
||||||
import com.projectkorra.projectkorra.firebending.FireBlast;
|
import com.projectkorra.projectkorra.firebending.FireBlast;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
|
@ -30,7 +33,8 @@ import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class SurgeWave extends WaterAbility {
|
@SuppressWarnings({ "deprecation", "unused" })
|
||||||
|
public class SurgeWave extends WaterAbility<SurgeConfig> {
|
||||||
|
|
||||||
private boolean freezing;
|
private boolean freezing;
|
||||||
private boolean activateFreeze;
|
private boolean activateFreeze;
|
||||||
|
@ -63,8 +67,8 @@ public class SurgeWave extends WaterAbility {
|
||||||
private Map<Block, Block> waveBlocks;
|
private Map<Block, Block> waveBlocks;
|
||||||
private Map<Block, Material> frozenBlocks;
|
private Map<Block, Material> frozenBlocks;
|
||||||
|
|
||||||
public SurgeWave(final Player player) {
|
public SurgeWave(final SurgeConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
SurgeWave wave = getAbility(player, SurgeWave.class);
|
SurgeWave wave = getAbility(player, SurgeWave.class);
|
||||||
if (wave != null) {
|
if (wave != null) {
|
||||||
|
@ -76,20 +80,20 @@ public class SurgeWave extends WaterAbility {
|
||||||
|
|
||||||
this.canHitSelf = true;
|
this.canHitSelf = true;
|
||||||
this.currentRadius = 1;
|
this.currentRadius = 1;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.Surge.Wave.Cooldown");
|
this.cooldown = config.WaveConfig.Cooldown;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.Surge.Wave.Interval");
|
this.interval = config.WaveConfig.Interval;
|
||||||
this.maxRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.Radius");
|
this.maxRadius = config.WaveConfig.Radius;
|
||||||
this.knockback = getConfig().getDouble("Abilities.Water.Surge.Wave.Knockback");
|
this.knockback = config.WaveConfig.Knockback;
|
||||||
this.knockup = getConfig().getDouble("Abilities.Water.Surge.Wave.Knockup");
|
this.knockup = config.WaveConfig.Knockup;
|
||||||
this.maxFreezeRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.MaxFreezeRadius");
|
this.maxFreezeRadius = config.WaveConfig.MaxFreezeRadius;
|
||||||
this.iceRevertTime = getConfig().getLong("Abilities.Water.Surge.Wave.IceRevertTime");
|
this.iceRevertTime = config.WaveConfig.IceRevertTime;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.Surge.Wave.Range");
|
this.range = config.WaveConfig.Range;
|
||||||
this.selectRange = getConfig().getDouble("Abilities.Water.Surge.Wave.SelectRange");
|
this.selectRange = config.WaveConfig.SelectRange;
|
||||||
this.waveBlocks = new ConcurrentHashMap<>();
|
this.waveBlocks = new ConcurrentHashMap<>();
|
||||||
this.frozenBlocks = new ConcurrentHashMap<>();
|
this.frozenBlocks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.maxRadius = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Surge.Wave.Radius");
|
this.maxRadius = config.WaveConfig.AvatarState_Radius;
|
||||||
}
|
}
|
||||||
this.maxRadius = this.getNightFactor(this.maxRadius);
|
this.maxRadius = this.getNightFactor(this.maxRadius);
|
||||||
|
|
||||||
|
@ -160,10 +164,10 @@ public class SurgeWave extends WaterAbility {
|
||||||
if (Commands.invincible.contains(((Player) entity).getName())) {
|
if (Commands.invincible.contains(((Player) entity).getName())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerHead") && GeneralMethods.playerHeadIsInBlock((Player) entity, block)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerHead && GeneralMethods.playerHeadIsInBlock((Player) entity, block)) {
|
||||||
continue ICE_SETTING;
|
continue ICE_SETTING;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerFeet") && GeneralMethods.playerFeetIsInBlock((Player) entity, block)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerFeet && GeneralMethods.playerFeetIsInBlock((Player) entity, block)) {
|
||||||
continue ICE_SETTING;
|
continue ICE_SETTING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import java.util.Random;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
@ -24,6 +23,9 @@ import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.TorrentConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.properties.WaterPropertiesConfig;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
|
@ -32,7 +34,8 @@ import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class Torrent extends WaterAbility {
|
@SuppressWarnings({ "deprecation", "unused" })
|
||||||
|
public class Torrent extends WaterAbility<TorrentConfig> {
|
||||||
|
|
||||||
private static final double CLEANUP_RANGE = 50;
|
private static final double CLEANUP_RANGE = 50;
|
||||||
private static final Map<TempBlock, Pair<Player, Integer>> FROZEN_BLOCKS = new ConcurrentHashMap<>();
|
private static final Map<TempBlock, Pair<Player, Integer>> FROZEN_BLOCKS = new ConcurrentHashMap<>();
|
||||||
|
@ -79,26 +82,26 @@ public class Torrent extends WaterAbility {
|
||||||
private ArrayList<TempBlock> launchedBlocks;
|
private ArrayList<TempBlock> launchedBlocks;
|
||||||
private ArrayList<Entity> hurtEntities;
|
private ArrayList<Entity> hurtEntities;
|
||||||
|
|
||||||
public Torrent(final Player player) {
|
public Torrent(final TorrentConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.layer = 0;
|
this.layer = 0;
|
||||||
this.startAngle = 0;
|
this.startAngle = 0;
|
||||||
this.maxLayer = getConfig().getInt("Abilities.Water.Torrent.MaxLayer");
|
this.maxLayer = config.MaxLayer;
|
||||||
this.knockback = getConfig().getDouble("Abilities.Water.Torrent.Knockback");
|
this.knockback = config.Knockback;
|
||||||
this.angle = getConfig().getDouble("Abilities.Water.Torrent.Angle");
|
this.angle = config.Angle;
|
||||||
this.radius = getConfig().getDouble("Abilities.Water.Torrent.Radius");
|
this.radius = config.Radius;
|
||||||
this.knockup = getConfig().getDouble("Abilities.Water.Torrent.Knockup");
|
this.knockup = config.Knockup;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.Torrent.Interval");
|
this.interval = config.Interval;
|
||||||
this.damage = getConfig().getDouble("Abilities.Water.Torrent.InitialDamage");
|
this.damage = config.InitialDamage;
|
||||||
this.successiveDamage = getConfig().getDouble("Abilities.Water.Torrent.SuccessiveDamage");
|
this.successiveDamage = config.SuccessiveDamage;
|
||||||
this.maxHits = getConfig().getInt("Abilities.Water.Torrent.MaxHits");
|
this.maxHits = config.MaxHits;
|
||||||
this.deflectDamage = getConfig().getDouble("Abilities.Water.Torrent.DeflectDamage");
|
this.deflectDamage = config.DeflectDamage;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.Torrent.Range");
|
this.range = config.Range;
|
||||||
this.selectRange = getConfig().getDouble("Abilities.Water.Torrent.SelectRange");
|
this.selectRange = config.SelectRange;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.Torrent.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.revert = getConfig().getBoolean("Abilities.Water.Torrent.Revert");
|
this.revert = config.Revert;
|
||||||
this.revertTime = getConfig().getLong("Abilities.Water.Torrent.RevertTime");
|
this.revertTime = config.RevertTime;
|
||||||
this.blocks = new ArrayList<>();
|
this.blocks = new ArrayList<>();
|
||||||
this.launchedBlocks = new ArrayList<>();
|
this.launchedBlocks = new ArrayList<>();
|
||||||
this.hurtEntities = new ArrayList<>();
|
this.hurtEntities = new ArrayList<>();
|
||||||
|
@ -119,10 +122,10 @@ public class Torrent extends WaterAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.Push");
|
this.knockback = config.AvatarState_Knockback;
|
||||||
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.InitialDamage");
|
this.damage = config.AvatarState_InitialDamage;
|
||||||
this.successiveDamage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.Torrent.SuccessiveDamage");
|
this.successiveDamage = config.AvatarState_SuccessiveDamage;
|
||||||
this.maxHits = getConfig().getInt("Abilities.Avatar.AvatarState.Water.Torrent.MaxHits");
|
this.maxHits = config.AvatarState_MaxHits;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.time = System.currentTimeMillis();
|
this.time = System.currentTimeMillis();
|
||||||
|
@ -148,10 +151,10 @@ public class Torrent extends WaterAbility {
|
||||||
if (Commands.invincible.contains(((Player) entity).getName())) {
|
if (Commands.invincible.contains(((Player) entity).getName())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerHead") && GeneralMethods.playerHeadIsInBlock((Player) entity, block)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerHead && GeneralMethods.playerHeadIsInBlock((Player) entity, block)) {
|
||||||
continue ICE_SETTING;
|
continue ICE_SETTING;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerFeet") && GeneralMethods.playerFeetIsInBlock((Player) entity, block)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerFeet && GeneralMethods.playerFeetIsInBlock((Player) entity, block)) {
|
||||||
continue ICE_SETTING;
|
continue ICE_SETTING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,7 +305,7 @@ public class Torrent extends WaterAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.formed && !this.player.isSneaking() && !this.launch) {
|
if (this.formed && !this.player.isSneaking() && !this.launch) {
|
||||||
new TorrentWave(this.player, this.radius);
|
new TorrentWave(config, this.player, this.radius);
|
||||||
this.remove();
|
this.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -531,7 +534,7 @@ public class Torrent extends WaterAbility {
|
||||||
new WaterReturn(this.player, location.getBlock());
|
new WaterReturn(this.player, location.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(final Player player) {
|
public static void create(final TorrentConfig config, final Player player) {
|
||||||
if (hasAbility(player, Torrent.class)) {
|
if (hasAbility(player, Torrent.class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -544,7 +547,7 @@ public class Torrent extends WaterAbility {
|
||||||
block.setType(Material.WATER);
|
block.setType(Material.WATER);
|
||||||
block.setBlockData(GeneralMethods.getWaterData(0));
|
block.setBlockData(GeneralMethods.getWaterData(0));
|
||||||
}
|
}
|
||||||
final Torrent tor = new Torrent(player);
|
final Torrent tor = new Torrent(config, player);
|
||||||
|
|
||||||
if (tor.sourceSelected || tor.settingUp) {
|
if (tor.sourceSelected || tor.settingUp) {
|
||||||
WaterReturn.emptyWaterBottle(player);
|
WaterReturn.emptyWaterBottle(player);
|
||||||
|
|
|
@ -17,10 +17,12 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.TorrentConfig;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class TorrentWave extends WaterAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class TorrentWave extends WaterAbility<TorrentConfig> {
|
||||||
|
|
||||||
private long time;
|
private long time;
|
||||||
private long interval;
|
private long interval;
|
||||||
|
@ -40,24 +42,24 @@ public class TorrentWave extends WaterAbility {
|
||||||
private ArrayList<Entity> affectedEntities;
|
private ArrayList<Entity> affectedEntities;
|
||||||
private Map<Integer, ConcurrentHashMap<Integer, Double>> heights;
|
private Map<Integer, ConcurrentHashMap<Integer, Double>> heights;
|
||||||
|
|
||||||
public TorrentWave(final Player player, final double radius) {
|
public TorrentWave(final TorrentConfig config, final Player player, final double radius) {
|
||||||
this(player, player.getEyeLocation(), radius);
|
this(config, player, player.getEyeLocation(), radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TorrentWave(final Player player, final Location location, final double radius) {
|
public TorrentWave(final TorrentConfig config, final Player player, final Location location, final double radius) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
if (this.bPlayer.isOnCooldown("TorrentWave")) {
|
if (this.bPlayer.isOnCooldown("TorrentWave")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.radius = radius;
|
this.radius = radius;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.Torrent.Wave.Interval");
|
this.interval = config.WaveConfig.Interval;
|
||||||
this.maxHeight = getConfig().getDouble("Abilities.Water.Torrent.Wave.Height");
|
this.maxHeight = config.WaveConfig.Height;
|
||||||
this.maxRadius = getConfig().getDouble("Abilities.Water.Torrent.Wave.Radius");
|
this.maxRadius = config.WaveConfig.Radius;
|
||||||
this.knockback = getConfig().getDouble("Abilities.Water.Torrent.Wave.Knockback");
|
this.knockback = config.WaveConfig.Knockback;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.Torrent.Wave.Cooldown");
|
this.cooldown = config.WaveConfig.Cooldown;
|
||||||
this.growSpeed = getConfig().getDouble("Abilities.Water.Torrent.Wave.GrowSpeed");
|
this.growSpeed = config.WaveConfig.GrowSpeed;
|
||||||
this.origin = location.clone();
|
this.origin = location.clone();
|
||||||
this.time = System.currentTimeMillis();
|
this.time = System.currentTimeMillis();
|
||||||
this.heights = new ConcurrentHashMap<>();
|
this.heights = new ConcurrentHashMap<>();
|
||||||
|
|
|
@ -18,10 +18,10 @@ import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||||
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterBubbleConfig;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
|
|
||||||
public class WaterBubble extends WaterAbility {
|
public class WaterBubble extends WaterAbility<WaterBubbleConfig> {
|
||||||
|
|
||||||
@Attribute("Click" + Attribute.DURATION)
|
@Attribute("Click" + Attribute.DURATION)
|
||||||
private long clickDuration;
|
private long clickDuration;
|
||||||
|
@ -39,8 +39,8 @@ public class WaterBubble extends WaterAbility {
|
||||||
private Location location;
|
private Location location;
|
||||||
private long lastActivation; // When the last click happened.
|
private long lastActivation; // When the last click happened.
|
||||||
|
|
||||||
public WaterBubble(final Player player, final boolean isShift) {
|
public WaterBubble(final WaterBubbleConfig config, final Player player, final boolean isShift) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.setFields();
|
this.setFields();
|
||||||
|
|
||||||
|
@ -77,10 +77,10 @@ public class WaterBubble extends WaterAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFields() {
|
public void setFields() {
|
||||||
this.clickDuration = ConfigManager.defaultConfig.get().getLong("Abilities.Water.WaterBubble.ClickDuration");
|
this.clickDuration = config.ClickDuration;
|
||||||
this.maxRadius = ConfigManager.defaultConfig.get().getDouble("Abilities.Water.WaterBubble.Radius");
|
this.maxRadius = config.Radius;
|
||||||
this.speed = ConfigManager.defaultConfig.get().getDouble("Abilities.Water.WaterBubble.Speed");
|
this.speed = config.Speed;
|
||||||
this.requireAir = ConfigManager.defaultConfig.get().getBoolean("Abilities.Water.WaterBubble.MustStartAboveWater");
|
this.requireAir = config.MustStartAboveWater;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.Collision;
|
import com.projectkorra.projectkorra.ability.util.Collision;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterManipulationConfig;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
|
@ -30,7 +31,8 @@ import com.projectkorra.projectkorra.waterbending.ice.PhaseChange;
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class WaterManipulation extends WaterAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class WaterManipulation extends WaterAbility<WaterManipulationConfig> {
|
||||||
|
|
||||||
private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<>();
|
private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@ -67,25 +69,25 @@ public class WaterManipulation extends WaterAbility {
|
||||||
private Vector targetDirection;
|
private Vector targetDirection;
|
||||||
private final HashSet<Byte> waterTypes;
|
private final HashSet<Byte> waterTypes;
|
||||||
|
|
||||||
public WaterManipulation(final Player player) {
|
public WaterManipulation(final WaterManipulationConfig config, final Player player) {
|
||||||
this(player, prepare(player, getConfig().getDouble("Abilities.Water.WaterManipulation.SelectRange")));
|
this(config, player, prepare(player, config.SelectRange));
|
||||||
}
|
}
|
||||||
|
|
||||||
public WaterManipulation(final Player player, final Block source) {
|
public WaterManipulation(final WaterManipulationConfig config, final Player player, final Block source) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.progressing = false;
|
this.progressing = false;
|
||||||
this.falling = false;
|
this.falling = false;
|
||||||
this.settingUp = false;
|
this.settingUp = false;
|
||||||
this.displacing = false;
|
this.displacing = false;
|
||||||
this.collisionRadius = getConfig().getDouble("Abilities.Water.WaterManipulation.CollisionRadius");
|
this.collisionRadius = config.CollisionRadius;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.WaterManipulation.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.selectRange = getConfig().getDouble("Abilities.Water.WaterManipulation.SelectRange");
|
this.selectRange = config.SelectRange;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.WaterManipulation.Range");
|
this.range = config.Range;
|
||||||
this.knockback = getConfig().getDouble("Abilities.Water.WaterManipulation.Knockback");
|
this.knockback = config.Knockback;
|
||||||
this.damage = getConfig().getDouble("Abilities.Water.WaterManipulation.Damage");
|
this.damage = config.Damage;
|
||||||
this.speed = getConfig().getDouble("Abilities.Water.WaterManipulation.Speed");
|
this.speed = config.Speed;
|
||||||
this.deflectRange = getConfig().getDouble("Abilities.Water.WaterManipulation.DeflectRange");
|
this.deflectRange = config.DeflectRange;
|
||||||
this.waterTypes = new HashSet<Byte>();
|
this.waterTypes = new HashSet<Byte>();
|
||||||
|
|
||||||
this.interval = (long) (1000. / this.speed);
|
this.interval = (long) (1000. / this.speed);
|
||||||
|
@ -286,7 +288,7 @@ public class WaterManipulation extends WaterAbility {
|
||||||
entity.setVelocity(vector.normalize().multiply(this.knockback));
|
entity.setVelocity(vector.normalize().multiply(this.knockback));
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.WaterManipulation.Damage");
|
this.damage = config.AvatarState_Damage;
|
||||||
}
|
}
|
||||||
this.damage = this.getNightFactor(this.damage);
|
this.damage = this.getNightFactor(this.damage);
|
||||||
DamageHandler.damageEntity(entity, this.damage, this);
|
DamageHandler.damageEntity(entity, this.damage, this);
|
||||||
|
@ -465,7 +467,7 @@ public class WaterManipulation extends WaterAbility {
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void moveWater(final Player player) {
|
public static void moveWater(final WaterManipulationConfig config, final Player player) {
|
||||||
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||||
if (bPlayer == null) {
|
if (bPlayer == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -502,7 +504,7 @@ public class WaterManipulation extends WaterAbility {
|
||||||
if (getTargetLocation(player, range).distanceSquared(block.getLocation()) > 1) {
|
if (getTargetLocation(player, range).distanceSquared(block.getLocation()) > 1) {
|
||||||
final TempBlock tb = new TempBlock(block, Material.WATER, GeneralMethods.getWaterData(0));
|
final TempBlock tb = new TempBlock(block, Material.WATER, GeneralMethods.getWaterData(0));
|
||||||
|
|
||||||
final WaterManipulation waterManip = new WaterManipulation(player, block);
|
final WaterManipulation waterManip = new WaterManipulation(config, player, block);
|
||||||
waterManip.moveWater();
|
waterManip.moveWater();
|
||||||
if (!waterManip.progressing) {
|
if (!waterManip.progressing) {
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
|
|
|
@ -17,10 +17,12 @@ import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.Collision;
|
import com.projectkorra.projectkorra.ability.util.Collision;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterSpoutConfig;
|
||||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
|
|
||||||
public class WaterSpout extends WaterAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class WaterSpout extends WaterAbility<WaterSpoutConfig> {
|
||||||
|
|
||||||
private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<Block, Block>();
|
private static final Map<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<Block, Block>();
|
||||||
private final List<TempBlock> blocks = new ArrayList<TempBlock>();
|
private final List<TempBlock> blocks = new ArrayList<TempBlock>();
|
||||||
|
@ -44,8 +46,8 @@ public class WaterSpout extends WaterAbility {
|
||||||
private Block base;
|
private Block base;
|
||||||
private TempBlock baseBlock;
|
private TempBlock baseBlock;
|
||||||
|
|
||||||
public WaterSpout(final Player player) {
|
public WaterSpout(final WaterSpoutConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
final WaterSpout oldSpout = getAbility(player, WaterSpout.class);
|
final WaterSpout oldSpout = getAbility(player, WaterSpout.class);
|
||||||
if (oldSpout != null) {
|
if (oldSpout != null) {
|
||||||
|
@ -53,17 +55,17 @@ public class WaterSpout extends WaterAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.canBendOnPackedIce = getConfig().getStringList("Properties.Water.IceBlocks").contains(Material.PACKED_ICE.toString());
|
this.canBendOnPackedIce = isIce(Material.PACKED_ICE);
|
||||||
this.useParticles = getConfig().getBoolean("Abilities.Water.WaterSpout.Particles");
|
this.useParticles = config.UseParticles;
|
||||||
this.useBlockSpiral = getConfig().getBoolean("Abilities.Water.WaterSpout.BlockSpiral");
|
this.useBlockSpiral = config.EnableBlockSpiral;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.WaterSpout.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.height = getConfig().getDouble("Abilities.Water.WaterSpout.Height");
|
this.height = config.Height;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.WaterSpout.Interval");
|
this.interval = config.Interval;
|
||||||
this.duration = getConfig().getLong("Abilities.Water.WaterSpout.Duration");
|
this.duration = config.Duration;
|
||||||
this.startTime = System.currentTimeMillis();
|
this.startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
this.maxHeight = this.getNightFactor(this.height);
|
this.maxHeight = this.getNightFactor(this.height);
|
||||||
final WaterSpoutWave spoutWave = new WaterSpoutWave(player, WaterSpoutWave.AbilityType.CLICK);
|
final WaterSpoutWave spoutWave = new WaterSpoutWave(config, player, WaterSpoutWave.AbilityType.CLICK);
|
||||||
if (spoutWave.isStarted() && !spoutWave.isRemoved()) {
|
if (spoutWave.isStarted() && !spoutWave.isRemoved()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,12 +26,18 @@ import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.IceWaveConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterSpoutConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterSpoutConfig.WaterSpoutWaveConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.properties.WaterPropertiesConfig;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.combo.IceWave;
|
import com.projectkorra.projectkorra.waterbending.combo.IceWave;
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
|
|
||||||
public class WaterSpoutWave extends WaterAbility {
|
@SuppressWarnings({ "deprecation", "unused" })
|
||||||
|
public class WaterSpoutWave extends WaterAbility<WaterSpoutConfig> {
|
||||||
|
|
||||||
public static enum AbilityType {
|
public static enum AbilityType {
|
||||||
CLICK, SHIFT, RELEASE
|
CLICK, SHIFT, RELEASE
|
||||||
|
@ -81,26 +87,26 @@ public class WaterSpoutWave extends WaterAbility {
|
||||||
private ArrayList<BukkitRunnable> tasks;
|
private ArrayList<BukkitRunnable> tasks;
|
||||||
private ConcurrentHashMap<Block, TempBlock> affectedBlocks;
|
private ConcurrentHashMap<Block, TempBlock> affectedBlocks;
|
||||||
|
|
||||||
public WaterSpoutWave(final Player player, final AbilityType type) {
|
public WaterSpoutWave(final WaterSpoutConfig config, final Player player, final AbilityType type) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.charging = false;
|
this.charging = false;
|
||||||
this.iceWave = false;
|
this.iceWave = false;
|
||||||
this.iceOnly = false;
|
this.iceOnly = false;
|
||||||
this.collidable = false;
|
this.collidable = false;
|
||||||
this.plant = getConfig().getBoolean("Abilities.Water.WaterSpout.Wave.AllowPlantSource");
|
this.plant = config.WaveConfig.AllowPlantSource;
|
||||||
this.radius = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.Radius");
|
this.radius = config.WaveConfig.Radius;
|
||||||
this.waveRadius = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.WaveRadius");
|
this.waveRadius = config.WaveConfig.WaveRadius;
|
||||||
this.thawRadius = getConfig().getDouble("Abilities.Water.IceWave.ThawRadius");
|
this.thawRadius = 0;
|
||||||
this.animationSpeed = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.AnimationSpeed");
|
this.animationSpeed = config.WaveConfig.AnimationSpeed;
|
||||||
this.selectRange = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.SelectRange");
|
this.selectRange = config.WaveConfig.SelectRange;
|
||||||
this.speed = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.Speed");
|
this.speed = config.WaveConfig.Speed;
|
||||||
this.damage = getConfig().getDouble("Abilities.Water.IceWave.Damage");
|
this.damage = 0;
|
||||||
this.chargeTime = getConfig().getLong("Abilities.Water.WaterSpout.Wave.ChargeTime");
|
this.chargeTime = config.WaveConfig.ChargeTime;
|
||||||
this.flightDuration = getConfig().getLong("Abilities.Water.WaterSpout.Wave.FlightDuration");
|
this.flightDuration = config.WaveConfig.FlightDuration;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.WaterSpout.Wave.Cooldown");
|
this.cooldown = config.WaveConfig.Cooldown;
|
||||||
this.revertSphereTime = getConfig().getLong("Abilities.Water.IceWave.RevertSphereTime");
|
this.revertSphereTime = 0;
|
||||||
this.revertIceSphere = getConfig().getBoolean("Abilities.Water.IceWave.RevertSphere");
|
this.revertIceSphere = false;
|
||||||
this.affectedBlocks = new ConcurrentHashMap<>();
|
this.affectedBlocks = new ConcurrentHashMap<>();
|
||||||
this.affectedEntities = new ArrayList<>();
|
this.affectedEntities = new ArrayList<>();
|
||||||
this.tasks = new ArrayList<>();
|
this.tasks = new ArrayList<>();
|
||||||
|
@ -113,8 +119,7 @@ public class WaterSpoutWave extends WaterAbility {
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.chargeTime = 0;
|
this.chargeTime = 0;
|
||||||
this.flightDuration = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.WaterWave.FlightDuration");
|
this.flightDuration = config.WaveConfig.AvatarState_FlightDuration;
|
||||||
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceWave.Damage");
|
|
||||||
this.cooldown = 0;
|
this.cooldown = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,10 +434,10 @@ public class WaterSpoutWave extends WaterAbility {
|
||||||
if (Commands.invincible.contains(((Player) entity).getName())) {
|
if (Commands.invincible.contains(((Player) entity).getName())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerHead") && GeneralMethods.playerHeadIsInBlock((Player) entity, block)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerHead && GeneralMethods.playerHeadIsInBlock((Player) entity, block)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerFeet") && GeneralMethods.playerFeetIsInBlock((Player) entity, block)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerFeet && GeneralMethods.playerFeetIsInBlock((Player) entity, block)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -579,8 +584,19 @@ public class WaterSpoutWave extends WaterAbility {
|
||||||
return this.iceWave;
|
return this.iceWave;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIceWave(final boolean iceWave) {
|
public void setIceWave(final IceWaveConfig iceConfig) {
|
||||||
this.iceWave = iceWave;
|
this.iceWave = iceConfig != null;
|
||||||
|
|
||||||
|
if (iceConfig != null) {
|
||||||
|
this.thawRadius = iceConfig.ThawRadius;
|
||||||
|
this.damage = iceConfig.Damage;
|
||||||
|
this.revertSphereTime = iceConfig.RevertSphereTime;
|
||||||
|
this.revertIceSphere = iceConfig.RevertSphere;
|
||||||
|
|
||||||
|
if (this.bPlayer.isAvatarState()) {
|
||||||
|
this.damage = iceConfig.AvatarState_Damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isIceOnly() {
|
public boolean isIceOnly() {
|
||||||
|
@ -590,10 +606,10 @@ public class WaterSpoutWave extends WaterAbility {
|
||||||
public void setIceOnly(final boolean iceOnly) {
|
public void setIceOnly(final boolean iceOnly) {
|
||||||
this.iceOnly = iceOnly;
|
this.iceOnly = iceOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return getConfig().getBoolean("Abilities.Water.WaterSpout.Wave.Enabled");
|
return config.WaveConfig.Enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMoving() {
|
public boolean isMoving() {
|
||||||
|
|
|
@ -22,11 +22,12 @@ import com.projectkorra.projectkorra.ability.AirAbility;
|
||||||
import com.projectkorra.projectkorra.ability.BloodAbility;
|
import com.projectkorra.projectkorra.ability.BloodAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.BloodbendingConfig;
|
||||||
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
|
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||||
|
|
||||||
public class Bloodbending extends BloodAbility {
|
public class Bloodbending extends BloodAbility<BloodbendingConfig> {
|
||||||
|
|
||||||
private static final Map<Entity, Player> TARGETED_ENTITIES = new ConcurrentHashMap<Entity, Player>();
|
private static final Map<Entity, Player> TARGETED_ENTITIES = new ConcurrentHashMap<Entity, Player>();
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ public class Bloodbending extends BloodAbility {
|
||||||
@Attribute("CanBloodbendOtherBloodbenders")
|
@Attribute("CanBloodbendOtherBloodbenders")
|
||||||
private boolean canBloodbendOtherBloodbenders;
|
private boolean canBloodbendOtherBloodbenders;
|
||||||
@Attribute(Attribute.RANGE)
|
@Attribute(Attribute.RANGE)
|
||||||
private int range;
|
private double range;
|
||||||
private long time;
|
private long time;
|
||||||
@Attribute(Attribute.DURATION)
|
@Attribute(Attribute.DURATION)
|
||||||
private long duration;
|
private long duration;
|
||||||
|
@ -48,8 +49,8 @@ public class Bloodbending extends BloodAbility {
|
||||||
private Entity target;
|
private Entity target;
|
||||||
private Vector vector;
|
private Vector vector;
|
||||||
|
|
||||||
public Bloodbending(final Player player) {
|
public Bloodbending(final BloodbendingConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
final Bloodbending ability = getAbility(player, Bloodbending.class);
|
final Bloodbending ability = getAbility(player, Bloodbending.class);
|
||||||
if (ability != null) {
|
if (ability != null) {
|
||||||
|
@ -57,14 +58,14 @@ public class Bloodbending extends BloodAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.canOnlyBeUsedAtNight = getConfig().getBoolean("Abilities.Water.Bloodbending.CanOnlyBeUsedAtNight");
|
this.canOnlyBeUsedAtNight = config.CanOnlyBeUsedAtNight;
|
||||||
this.canBeUsedOnUndeadMobs = getConfig().getBoolean("Abilities.Water.Bloodbending.CanBeUsedOnUndeadMobs");
|
this.canBeUsedOnUndeadMobs = config.CanBeUsedOnUndeadMobs;
|
||||||
this.onlyUsableDuringMoon = getConfig().getBoolean("Abilities.Water.Bloodbending.CanOnlyBeUsedDuringFullMoon");
|
this.onlyUsableDuringMoon = config.CanOnlyBeUsedDuringFullMoon;
|
||||||
this.canBloodbendOtherBloodbenders = getConfig().getBoolean("Abilities.Water.Bloodbending.CanBloodbendOtherBloodbenders");
|
this.canBloodbendOtherBloodbenders = config.CanBloodbendOtherBloodbenders;
|
||||||
this.range = getConfig().getInt("Abilities.Water.Bloodbending.Range");
|
this.range = config.Range;
|
||||||
this.duration = getConfig().getInt("Abilities.Water.Bloodbending.Duration");
|
this.duration = config.Duration;
|
||||||
this.cooldown = getConfig().getInt("Abilities.Water.Bloodbending.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.knockback = getConfig().getDouble("Abilities.Water.Bloodbending.Knockback");
|
this.knockback = config.Knockback;
|
||||||
this.vector = new Vector(0, 0, 0);
|
this.vector = new Vector(0, 0, 0);
|
||||||
|
|
||||||
if (this.canOnlyBeUsedAtNight && !isNight(player.getWorld()) && !this.bPlayer.canBloodbendAtAnytime()) {
|
if (this.canOnlyBeUsedAtNight && !isNight(player.getWorld()) && !this.bPlayer.canBloodbendAtAnytime()) {
|
||||||
|
@ -404,11 +405,11 @@ public class Bloodbending extends BloodAbility {
|
||||||
this.canBloodbendOtherBloodbenders = canBloodbendOtherBloodbenders;
|
this.canBloodbendOtherBloodbenders = canBloodbendOtherBloodbenders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRange() {
|
public double getRange() {
|
||||||
return this.range;
|
return this.range;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRange(final int range) {
|
public void setRange(final double range) {
|
||||||
this.range = range;
|
this.range = range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.projectkorra.projectkorra.ability.util.Collision;
|
||||||
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.IceBulletConfig;
|
||||||
import com.projectkorra.projectkorra.firebending.combo.FireComboStream;
|
import com.projectkorra.projectkorra.firebending.combo.FireComboStream;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
|
@ -33,7 +34,8 @@ import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterSourceGrabber;
|
import com.projectkorra.projectkorra.waterbending.util.WaterSourceGrabber;
|
||||||
|
|
||||||
public class IceBullet extends IceAbility implements ComboAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class IceBullet extends IceAbility<IceBulletConfig> implements ComboAbility<IceBulletConfig> {
|
||||||
|
|
||||||
public static enum AbilityState {
|
public static enum AbilityState {
|
||||||
ICE_PILLAR_RISING, ICE_BULLET_FORMING
|
ICE_PILLAR_RISING, ICE_BULLET_FORMING
|
||||||
|
@ -58,7 +60,6 @@ public class IceBullet extends IceAbility implements ComboAbility {
|
||||||
private long cooldown;
|
private long cooldown;
|
||||||
private long shotcooldown;
|
private long shotcooldown;
|
||||||
private long time;
|
private long time;
|
||||||
private String name;
|
|
||||||
private AbilityState state;
|
private AbilityState state;
|
||||||
private Location origin;
|
private Location origin;
|
||||||
private Location location;
|
private Location location;
|
||||||
|
@ -67,8 +68,8 @@ public class IceBullet extends IceAbility implements ComboAbility {
|
||||||
private ArrayList<BukkitRunnable> tasks;
|
private ArrayList<BukkitRunnable> tasks;
|
||||||
private ConcurrentHashMap<Block, TempBlock> affectedBlocks;
|
private ConcurrentHashMap<Block, TempBlock> affectedBlocks;
|
||||||
|
|
||||||
public IceBullet(final Player player) {
|
public IceBullet(final IceBulletConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.time = System.currentTimeMillis();
|
this.time = System.currentTimeMillis();
|
||||||
this.tasks = new ArrayList<>();
|
this.tasks = new ArrayList<>();
|
||||||
|
@ -78,16 +79,15 @@ public class IceBullet extends IceAbility implements ComboAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.damage = getConfig().getDouble("Abilities.Water.IceBullet.Damage");
|
this.damage = config.Damage;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.IceBullet.Range");
|
this.range = config.Range;
|
||||||
this.radius = getConfig().getDouble("Abilities.Water.IceBullet.Radius");
|
this.radius = config.Radius;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.IceBullet.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.shotcooldown = getConfig().getLong("Abilities.Water.IceBullet.ShotCooldown");
|
this.shotcooldown = config.ShotCooldown;
|
||||||
this.shootTime = getConfig().getLong("Abilities.Water.IceBullet.ShootTime");
|
this.shootTime = config.ShootTime;
|
||||||
this.maxShots = getConfig().getInt("Abilities.Water.IceBullet.MaxShots");
|
this.maxShots = config.MaxShots;
|
||||||
this.animationSpeed = getConfig().getDouble("Abilities.Water.IceBullet.AnimationSpeed");
|
this.animationSpeed = config.AnimationSpeed;
|
||||||
this.speed = 1;
|
this.speed = 1;
|
||||||
this.name = this.getName();
|
|
||||||
|
|
||||||
double aug = getNightFactor(player.getWorld());
|
double aug = getNightFactor(player.getWorld());
|
||||||
if (aug > 1) {
|
if (aug > 1) {
|
||||||
|
@ -101,7 +101,7 @@ public class IceBullet extends IceAbility implements ComboAbility {
|
||||||
this.radius *= aug;
|
this.radius *= aug;
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Water.IceBullet.Cooldown");
|
this.cooldown = config.AvatarState_Cooldown;
|
||||||
this.damage = AvatarState.getValue(this.damage);
|
this.damage = AvatarState.getValue(this.damage);
|
||||||
this.range = AvatarState.getValue(this.range);
|
this.range = AvatarState.getValue(this.range);
|
||||||
this.shootTime = AvatarState.getValue(this.shootTime);
|
this.shootTime = AvatarState.getValue(this.shootTime);
|
||||||
|
@ -343,8 +343,8 @@ public class IceBullet extends IceAbility implements ComboAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object createNewComboInstance(final Player player) {
|
public Object createNewComboInstance(final IceBulletConfig config, final Player player) {
|
||||||
return new IceBullet(player);
|
return new IceBullet(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -520,7 +520,4 @@ public class IceBullet extends IceAbility implements ComboAbility {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(final String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,12 @@ import com.projectkorra.projectkorra.ability.ComboAbility;
|
||||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.IceWaveConfig;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterSpoutWave;
|
import com.projectkorra.projectkorra.waterbending.WaterSpoutWave;
|
||||||
|
|
||||||
public class IceWave extends IceAbility implements ComboAbility {
|
public class IceWave extends IceAbility<IceWaveConfig> implements ComboAbility<IceWaveConfig> {
|
||||||
|
|
||||||
private static final Map<Block, TempBlock> FROZEN_BLOCKS = new ConcurrentHashMap<>();
|
private static final Map<Block, TempBlock> FROZEN_BLOCKS = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@ -24,8 +25,8 @@ public class IceWave extends IceAbility implements ComboAbility {
|
||||||
private long cooldown;
|
private long cooldown;
|
||||||
private Location origin;
|
private Location origin;
|
||||||
|
|
||||||
public IceWave(final Player player) {
|
public IceWave(final IceWaveConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) {
|
if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) {
|
||||||
return;
|
return;
|
||||||
|
@ -36,7 +37,7 @@ public class IceWave extends IceAbility implements ComboAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.IceWave.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.cooldown = 0;
|
this.cooldown = 0;
|
||||||
|
@ -62,7 +63,7 @@ public class IceWave extends IceAbility implements ComboAbility {
|
||||||
this.origin = this.player.getLocation();
|
this.origin = this.player.getLocation();
|
||||||
|
|
||||||
final WaterSpoutWave wave = WaterSpoutWave.getType(this.player, WaterSpoutWave.AbilityType.RELEASE).get(0);
|
final WaterSpoutWave wave = WaterSpoutWave.getType(this.player, WaterSpoutWave.AbilityType.RELEASE).get(0);
|
||||||
wave.setIceWave(true);
|
wave.setIceWave(config);
|
||||||
} else if (!WaterSpoutWave.containsType(this.player, WaterSpoutWave.AbilityType.RELEASE)) {
|
} else if (!WaterSpoutWave.containsType(this.player, WaterSpoutWave.AbilityType.RELEASE)) {
|
||||||
this.remove();
|
this.remove();
|
||||||
return;
|
return;
|
||||||
|
@ -114,8 +115,8 @@ public class IceWave extends IceAbility implements ComboAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object createNewComboInstance(final Player player) {
|
public Object createNewComboInstance(final IceWaveConfig config, final Player player) {
|
||||||
return new IceWave(player);
|
return new IceWave(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,10 +20,12 @@ import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.HealingAbility;
|
import com.projectkorra.projectkorra.ability.HealingAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.chiblocking.Smokescreen;
|
import com.projectkorra.projectkorra.chiblocking.Smokescreen;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.HealingWatersConfig;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class HealingWaters extends HealingAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class HealingWaters extends HealingAbility<HealingWatersConfig> {
|
||||||
|
|
||||||
// Configurable Variables.
|
// Configurable Variables.
|
||||||
@Attribute(Attribute.COOLDOWN)
|
@Attribute(Attribute.COOLDOWN)
|
||||||
|
@ -55,8 +57,8 @@ public class HealingWaters extends HealingAbility {
|
||||||
private boolean hasReached = false;
|
private boolean hasReached = false;
|
||||||
private String hex;
|
private String hex;
|
||||||
|
|
||||||
public HealingWaters(final Player player) {
|
public HealingWaters(final HealingWatersConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
if (!this.bPlayer.canBend(this)) {
|
if (!this.bPlayer.canBend(this)) {
|
||||||
this.remove();
|
this.remove();
|
||||||
|
@ -77,13 +79,13 @@ public class HealingWaters extends HealingAbility {
|
||||||
|
|
||||||
public void setFields() {
|
public void setFields() {
|
||||||
|
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.HealingWaters.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.HealingWaters.Range");
|
this.range = config.Range;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.HealingWaters.Interval");
|
this.interval = config.Interval;
|
||||||
this.chargeTime = getConfig().getLong("Abilities.Water.HealingWaters.ChargeTime");
|
this.chargeTime = config.ChargeTime;
|
||||||
this.potionPotency = getConfig().getInt("Abilities.Water.HealingWaters.PotionPotency");
|
this.potionPotency = config.PotionPotency;
|
||||||
this.duration = getConfig().getLong("Abilities.Water.HealingWaters.Duration");
|
this.duration = config.Duration;
|
||||||
this.enableParticles = getConfig().getBoolean("Abilities.Water.HealingWaters.EnableParticles");
|
this.enableParticles = config.EnableParticles;
|
||||||
this.hex = "00ffff";
|
this.hex = "00ffff";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.AirAbility;
|
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.IceBlastConfig;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
|
@ -28,7 +29,7 @@ import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class IceBlast extends IceAbility {
|
public class IceBlast extends IceAbility<IceBlastConfig> {
|
||||||
|
|
||||||
private boolean prepared;
|
private boolean prepared;
|
||||||
private boolean settingUp;
|
private boolean settingUp;
|
||||||
|
@ -52,17 +53,17 @@ public class IceBlast extends IceAbility {
|
||||||
private boolean allowSnow;
|
private boolean allowSnow;
|
||||||
public TempBlock source;
|
public TempBlock source;
|
||||||
|
|
||||||
public IceBlast(final Player player) {
|
public IceBlast(final IceBlastConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.data = 0;
|
this.data = 0;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.IceBlast.Interval");
|
this.interval = config.Interval;
|
||||||
this.collisionRadius = getConfig().getDouble("Abilities.Water.IceBlast.CollisionRadius");
|
this.collisionRadius = config.CollisionRadius;
|
||||||
this.deflectRange = getConfig().getDouble("Abilities.Water.IceBlast.DeflectRange");
|
this.deflectRange = config.DeflectRange;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.IceBlast.Range");
|
this.range = config.Range;
|
||||||
this.damage = getConfig().getInt("Abilities.Water.IceBlast.Damage");
|
this.damage = config.Damage;
|
||||||
this.cooldown = getConfig().getInt("Abilities.Water.IceBlast.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.allowSnow = getConfig().getBoolean("Abilities.Water.IceBlast.AllowSnow");
|
this.allowSnow = config.AllowSnow;
|
||||||
|
|
||||||
this.damage = getNightFactor(this.damage, player.getWorld());
|
this.damage = getNightFactor(this.damage, player.getWorld());
|
||||||
|
|
||||||
|
@ -71,9 +72,9 @@ public class IceBlast extends IceAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Water.IceBlast.Cooldown");
|
this.cooldown = config.AvatarState_Cooldown;
|
||||||
this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceBlast.Range");
|
this.range = config.AvatarState_Range;
|
||||||
this.damage = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceBlast.Damage");
|
this.damage = config.AvatarState_Damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
block(player);
|
block(player);
|
||||||
|
|
|
@ -18,13 +18,14 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.AirAbility;
|
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.IceSpikeConfig;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class IceSpikeBlast extends IceAbility {
|
public class IceSpikeBlast extends IceAbility<IceSpikeConfig> {
|
||||||
|
|
||||||
private boolean prepared;
|
private boolean prepared;
|
||||||
private boolean settingUp;
|
private boolean settingUp;
|
||||||
|
@ -54,23 +55,23 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
private TempBlock source;
|
private TempBlock source;
|
||||||
private Material sourceType;
|
private Material sourceType;
|
||||||
|
|
||||||
public IceSpikeBlast(final Player player) {
|
public IceSpikeBlast(final IceSpikeConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
if (this.bPlayer.isOnCooldown("IceSpikeBlast")) {
|
if (this.bPlayer.isOnCooldown("IceSpikeBlast")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.data = 0;
|
this.data = 0;
|
||||||
this.interval = getConfig().getLong("Abilities.Water.IceSpike.Blast.Interval");
|
this.interval = config.BlastConfig.Interval;
|
||||||
this.slowCooldown = getConfig().getLong("Abilities.Water.IceSpike.Blast.SlowCooldown");
|
this.slowCooldown = config.BlastConfig.SlowCooldown;
|
||||||
this.collisionRadius = getConfig().getDouble("Abilities.Water.IceSpike.Blast.CollisionRadius");
|
this.collisionRadius = config.BlastConfig.CollisionRadius;
|
||||||
this.deflectRange = getConfig().getDouble("Abilities.Water.IceSpike.Blast.DeflectRange");
|
this.deflectRange = config.BlastConfig.DeflectRange;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Range");
|
this.range = config.BlastConfig.Range;
|
||||||
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Damage");
|
this.damage = config.BlastConfig.Damage;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Blast.Cooldown");
|
this.cooldown = config.BlastConfig.Cooldown;
|
||||||
this.slowPotency = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowPotency");
|
this.slowPotency = config.BlastConfig.SlowPotency;
|
||||||
this.slowDuration = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowDuration");
|
this.slowDuration = config.BlastConfig.SlowDuration;
|
||||||
|
|
||||||
if (!this.bPlayer.canBend(this) || !this.bPlayer.canIcebend()) {
|
if (!this.bPlayer.canBend(this) || !this.bPlayer.canIcebend()) {
|
||||||
return;
|
return;
|
||||||
|
@ -79,10 +80,10 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.cooldown = 0;
|
this.cooldown = 0;
|
||||||
this.slowCooldown = 0;
|
this.slowCooldown = 0;
|
||||||
this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Range");
|
this.range = config.BlastConfig.AvatarState_Range;
|
||||||
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.Damage");
|
this.damage = config.BlastConfig.AvatarState_Damage;
|
||||||
this.slowPotency = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowPotency");
|
this.slowPotency = config.BlastConfig.AvatarState_SlowPotency;
|
||||||
this.slowDuration = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.Blast.SlowDuration");
|
this.slowDuration = config.BlastConfig.AvatarState_SlowDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
block(player);
|
block(player);
|
||||||
|
@ -95,7 +96,7 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.sourceBlock == null) {
|
if (this.sourceBlock == null) {
|
||||||
new IceSpikePillarField(player);
|
new IceSpikePillarField(config, player);
|
||||||
} else if (GeneralMethods.isRegionProtectedFromBuild(this, this.sourceBlock.getLocation())) {
|
} else if (GeneralMethods.isRegionProtectedFromBuild(this, this.sourceBlock.getLocation())) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -295,7 +296,7 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void activate(final Player player) {
|
public static void activate(final IceSpikeConfig config, final Player player) {
|
||||||
redirect(player);
|
redirect(player);
|
||||||
boolean activate = false;
|
boolean activate = false;
|
||||||
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||||
|
@ -317,9 +318,9 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!activate && !getPlayers(IceSpikeBlast.class).contains(player)) {
|
if (!activate && !getPlayers(IceSpikeBlast.class).contains(player)) {
|
||||||
final IceSpikePillar spike = new IceSpikePillar(player);
|
final IceSpikePillar spike = new IceSpikePillar(config, player);
|
||||||
if (!spike.isStarted()) {
|
if (!spike.isStarted()) {
|
||||||
waterBottle(player);
|
waterBottle(config, player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -387,21 +388,19 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void waterBottle(final Player player) {
|
private static void waterBottle(final IceSpikeConfig config, final Player player) {
|
||||||
final long range = getConfig().getLong("Abilities.Water.IceSpike.Projectile.Range");
|
|
||||||
|
|
||||||
if (WaterReturn.hasWaterBottle(player)) {
|
if (WaterReturn.hasWaterBottle(player)) {
|
||||||
final Location eyeLoc = player.getEyeLocation();
|
final Location eyeLoc = player.getEyeLocation();
|
||||||
final Block block = eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock();
|
final Block block = eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock();
|
||||||
|
|
||||||
if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) {
|
if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) {
|
||||||
final LivingEntity target = (LivingEntity) GeneralMethods.getTargetedEntity(player, range);
|
final LivingEntity target = (LivingEntity) GeneralMethods.getTargetedEntity(player, config.BlastConfig.ProjectileRange);
|
||||||
Location destination;
|
Location destination;
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
destination = GeneralMethods.getTargetedLocation(player, range, getTransparentMaterials());
|
destination = GeneralMethods.getTargetedLocation(player, config.BlastConfig.ProjectileRange, getTransparentMaterials());
|
||||||
} else {
|
} else {
|
||||||
destination = GeneralMethods.getPointOnLine(player.getEyeLocation(), target.getEyeLocation(), range);
|
destination = GeneralMethods.getPointOnLine(player.getEyeLocation(), target.getEyeLocation(), config.BlastConfig.ProjectileRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destination.distanceSquared(block.getLocation()) < 1) {
|
if (destination.distanceSquared(block.getLocation()) < 1) {
|
||||||
|
@ -411,7 +410,7 @@ public class IceSpikeBlast extends IceAbility {
|
||||||
final BlockState state = block.getState();
|
final BlockState state = block.getState();
|
||||||
block.setType(Material.WATER);
|
block.setType(Material.WATER);
|
||||||
block.setBlockData(GeneralMethods.getWaterData(0));
|
block.setBlockData(GeneralMethods.getWaterData(0));
|
||||||
final IceSpikeBlast iceSpike = new IceSpikeBlast(player);
|
final IceSpikeBlast iceSpike = new IceSpikeBlast(config, player);
|
||||||
iceSpike.throwIce();
|
iceSpike.throwIce();
|
||||||
iceSpike.sourceBlock = null;
|
iceSpike.sourceBlock = null;
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,15 @@ import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.IceSpikeConfig;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||||
|
|
||||||
public class IceSpikePillar extends IceAbility {
|
public class IceSpikePillar extends IceAbility<IceSpikeConfig> {
|
||||||
|
|
||||||
/** The list of blocks IceSpike uses */
|
/** The list of blocks IceSpike uses */
|
||||||
private final Map<Block, TempBlock> ice_blocks = new HashMap<Block, TempBlock>();
|
private final Map<Block, TempBlock> ice_blocks = new HashMap<>();
|
||||||
|
|
||||||
@Attribute(Attribute.HEIGHT)
|
@Attribute(Attribute.HEIGHT)
|
||||||
private int height;
|
private int height;
|
||||||
|
@ -62,8 +63,8 @@ public class IceSpikePillar extends IceAbility {
|
||||||
private ArrayList<LivingEntity> damaged;
|
private ArrayList<LivingEntity> damaged;
|
||||||
protected boolean inField = false; // If it's part of a field or not.
|
protected boolean inField = false; // If it's part of a field or not.
|
||||||
|
|
||||||
public IceSpikePillar(final Player player) {
|
public IceSpikePillar(final IceSpikeConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
this.setFields();
|
this.setFields();
|
||||||
|
|
||||||
if (this.bPlayer.isOnCooldown("IceSpikePillar")) {
|
if (this.bPlayer.isOnCooldown("IceSpikePillar")) {
|
||||||
|
@ -110,8 +111,8 @@ public class IceSpikePillar extends IceAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IceSpikePillar(final Player player, final Location origin, final int damage, final Vector throwing, final long aoecooldown) {
|
public IceSpikePillar(final IceSpikeConfig config, final Player player, final Location origin, final int damage, final Vector throwing, final long aoecooldown) {
|
||||||
super(player);
|
super(config, player);
|
||||||
this.setFields();
|
this.setFields();
|
||||||
|
|
||||||
this.cooldown = aoecooldown;
|
this.cooldown = aoecooldown;
|
||||||
|
@ -132,26 +133,26 @@ public class IceSpikePillar extends IceAbility {
|
||||||
|
|
||||||
private void setFields() {
|
private void setFields() {
|
||||||
this.direction = new Vector(0, 1, 0);
|
this.direction = new Vector(0, 1, 0);
|
||||||
this.speed = getConfig().getDouble("Abilities.Water.IceSpike.Speed");
|
this.speed = config.Speed;
|
||||||
this.slowCooldown = getConfig().getLong("Abilities.Water.IceSpike.SlowCooldown");
|
this.slowCooldown = config.SlowCooldown;
|
||||||
this.slowPower = getConfig().getInt("Abilities.Water.IceSpike.SlowPower");
|
this.slowPower = config.SlowPower;
|
||||||
this.slowDuration = getConfig().getInt("Abilities.Water.IceSpike.SlowDuration");
|
this.slowDuration = config.SlowDuration;
|
||||||
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Damage");
|
this.damage = config.Damage;
|
||||||
this.range = getConfig().getDouble("Abilities.Water.IceSpike.Range");
|
this.range = config.Range;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.height = getConfig().getInt("Abilities.Water.IceSpike.Height");
|
this.height = config.Height;
|
||||||
this.thrownForce = new Vector(0, getConfig().getDouble("Abilities.Water.IceSpike.Push"), 0);
|
this.thrownForce = new Vector(0, config.Push, 0);
|
||||||
this.damaged = new ArrayList<>();
|
this.damaged = new ArrayList<>();
|
||||||
|
|
||||||
this.interval = (long) (1000. / this.speed);
|
this.interval = (long) (1000. / this.speed);
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.slowPower = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.SlowPower");
|
this.slowPower = config.AvatarState_SlowPower;
|
||||||
this.slowDuration = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.SlowDuration");
|
this.slowDuration = config.AvatarState_SlowDuration;
|
||||||
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Damage");
|
this.damage = config.AvatarState_Damage;
|
||||||
this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Range");
|
this.range = config.AvatarState_Range;
|
||||||
this.height = getConfig().getInt("Abilities.Avatar.AvatarState.Water.IceSpike.Height");
|
this.height = config.AvatarState_Height;
|
||||||
this.thrownForce = new Vector(0, getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Push"), 0);
|
this.thrownForce.setY(config.AvatarState_Push);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,10 @@ import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.IceSpikeConfig;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
|
|
||||||
public class IceSpikePillarField extends IceAbility {
|
public class IceSpikePillarField extends IceAbility<IceSpikeConfig> {
|
||||||
|
|
||||||
@Attribute(Attribute.DAMAGE)
|
@Attribute(Attribute.DAMAGE)
|
||||||
private double damage;
|
private double damage;
|
||||||
|
@ -34,21 +35,21 @@ public class IceSpikePillarField extends IceAbility {
|
||||||
private double knockup;
|
private double knockup;
|
||||||
private Vector thrownForce;
|
private Vector thrownForce;
|
||||||
|
|
||||||
public IceSpikePillarField(final Player player) {
|
public IceSpikePillarField(final IceSpikeConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
if (this.bPlayer.isOnCooldown("IceSpikePillarField")) {
|
if (this.bPlayer.isOnCooldown("IceSpikePillarField")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Field.Damage");
|
this.damage = config.FieldConfig.Damage;
|
||||||
this.radius = getConfig().getDouble("Abilities.Water.IceSpike.Field.Radius");
|
this.radius = config.FieldConfig.Radius;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Field.Cooldown");
|
this.cooldown = config.FieldConfig.Cooldown;
|
||||||
this.knockup = getConfig().getDouble("Abilities.Water.IceSpike.Field.Knockup");
|
this.knockup = config.FieldConfig.Knockup;
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Damage");
|
this.damage = config.FieldConfig.AvatarState_Damage;
|
||||||
this.radius = getConfig().getDouble("Abilities.Avatar.AvatarState.Water.IceSpike.Field.Radius");
|
this.radius = config.FieldConfig.AvatarState_Radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.numberOfSpikes = (int) (((this.radius) * (this.radius)) / 4);
|
this.numberOfSpikes = (int) (((this.radius) * (this.radius)) / 4);
|
||||||
|
@ -118,7 +119,7 @@ public class IceSpikePillarField extends IceAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetBlock.getRelative(BlockFace.UP).getType() != Material.ICE) {
|
if (targetBlock.getRelative(BlockFace.UP).getType() != Material.ICE) {
|
||||||
final IceSpikePillar pillar = new IceSpikePillar(this.player, targetBlock.getLocation(), (int) this.damage, this.thrownForce, this.cooldown);
|
final IceSpikePillar pillar = new IceSpikePillar(config, this.player, targetBlock.getLocation(), (int) this.damage, this.thrownForce, this.cooldown);
|
||||||
pillar.inField = true;
|
pillar.inField = true;
|
||||||
iceBlocks.remove(targetBlock);
|
iceBlocks.remove(targetBlock);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -19,6 +19,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.PhaseChangeConfig;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.SurgeWall;
|
import com.projectkorra.projectkorra.waterbending.SurgeWall;
|
||||||
import com.projectkorra.projectkorra.waterbending.SurgeWave;
|
import com.projectkorra.projectkorra.waterbending.SurgeWave;
|
||||||
|
@ -26,7 +27,8 @@ import com.projectkorra.projectkorra.waterbending.Torrent;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterSpoutWave;
|
import com.projectkorra.projectkorra.waterbending.WaterSpoutWave;
|
||||||
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArmsSpear;
|
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArmsSpear;
|
||||||
|
|
||||||
public class PhaseChange extends IceAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class PhaseChange extends IceAbility<PhaseChangeConfig> {
|
||||||
|
|
||||||
public static enum PhaseChangeType {
|
public static enum PhaseChangeType {
|
||||||
FREEZE, MELT, CUSTOM;
|
FREEZE, MELT, CUSTOM;
|
||||||
|
@ -50,7 +52,7 @@ public class PhaseChange extends IceAbility {
|
||||||
private final Random r = new Random();
|
private final Random r = new Random();
|
||||||
|
|
||||||
@Attribute(Attribute.SELECT_RANGE)
|
@Attribute(Attribute.SELECT_RANGE)
|
||||||
private int sourceRange = 8;
|
private double sourceRange = 8;
|
||||||
|
|
||||||
// Freeze Variables.
|
// Freeze Variables.
|
||||||
@Attribute("Freeze" + Attribute.COOLDOWN)
|
@Attribute("Freeze" + Attribute.COOLDOWN)
|
||||||
|
@ -75,8 +77,8 @@ public class PhaseChange extends IceAbility {
|
||||||
private boolean allowMeltFlow;
|
private boolean allowMeltFlow;
|
||||||
private final CopyOnWriteArrayList<Block> melted_blocks = new CopyOnWriteArrayList<>();
|
private final CopyOnWriteArrayList<Block> melted_blocks = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
public PhaseChange(final Player player, final PhaseChangeType type) {
|
public PhaseChange(final PhaseChangeConfig config, final Player player, final PhaseChangeType type) {
|
||||||
super(player);
|
super(config, player);
|
||||||
this.startNewType(type);
|
this.startNewType(type);
|
||||||
this.start();
|
this.start();
|
||||||
}
|
}
|
||||||
|
@ -158,33 +160,33 @@ public class PhaseChange extends IceAbility {
|
||||||
if (isNight(this.player.getWorld())) {
|
if (isNight(this.player.getWorld())) {
|
||||||
night = (int) Math.round(getNightFactor());
|
night = (int) Math.round(getNightFactor());
|
||||||
}
|
}
|
||||||
this.sourceRange = night * getConfig().getInt("Abilities.Water.PhaseChange.SourceRange");
|
this.sourceRange = night * config.SourceRange;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case FREEZE:
|
case FREEZE:
|
||||||
this.depth = night * getConfig().getInt("Abilities.Water.PhaseChange.Freeze.Depth");
|
this.depth = night * config.FreezeConfig.Depth;
|
||||||
this.controlRadius = night * getConfig().getDouble("Abilities.Water.PhaseChange.Freeze.ControlRadius");
|
this.controlRadius = night * config.FreezeConfig.ControlRadius;
|
||||||
this.freezeCooldown = getConfig().getLong("Abilities.Water.PhaseChange.Freeze.Cooldown");
|
this.freezeCooldown = config.FreezeConfig.Cooldown;
|
||||||
this.freezeRadius = night * getConfig().getInt("Abilities.Water.PhaseChange.Freeze.Radius");
|
this.freezeRadius = night * config.FreezeConfig.Radius;
|
||||||
|
|
||||||
this.freezeArea(GeneralMethods.getTargetedLocation(this.player, this.sourceRange));
|
this.freezeArea(GeneralMethods.getTargetedLocation(this.player, this.sourceRange));
|
||||||
case MELT:
|
case MELT:
|
||||||
this.meltRadius = 1;
|
this.meltRadius = 1;
|
||||||
this.meltCooldown = getConfig().getLong("Abilities.Water.PhaseChange.Melt.Cooldown");
|
this.meltCooldown = config.MeltConfig.Cooldown;
|
||||||
this.meltSpeed = getConfig().getDouble("Abilities.Water.PhaseChange.Melt.Speed") * night;
|
this.meltSpeed = config.MeltConfig.Speed * night;
|
||||||
this.meltMaxRadius = night * getConfig().getInt("Abilities.Water.PhaseChange.Melt.Radius");
|
this.meltMaxRadius = night * config.MeltConfig.Radius;
|
||||||
this.allowMeltFlow = getConfig().getBoolean("Abilities.Water.PhaseChange.Melt.AllowFlow");
|
this.allowMeltFlow = config.MeltConfig.AllowFlow;
|
||||||
case CUSTOM:
|
case CUSTOM:
|
||||||
this.depth = night * getConfig().getInt("Abilities.Water.PhaseChange.Freeze.Depth");
|
this.depth = night * config.FreezeConfig.Depth;
|
||||||
this.controlRadius = night * getConfig().getDouble("Abilities.Water.PhaseChange.Freeze.ControlRadius");
|
this.controlRadius = night * config.FreezeConfig.ControlRadius;
|
||||||
this.freezeCooldown = getConfig().getLong("Abilities.Water.PhaseChange.Freeze.Cooldown");
|
this.freezeCooldown = config.FreezeConfig.Cooldown;
|
||||||
this.freezeRadius = night * getConfig().getInt("Abilities.Water.PhaseChange.Freeze.Radius");
|
this.freezeRadius = night * config.FreezeConfig.Radius;
|
||||||
|
|
||||||
this.meltRadius = 1;
|
this.meltRadius = 1;
|
||||||
this.meltCooldown = getConfig().getLong("Abilities.Water.PhaseChange.Melt.Cooldown");
|
this.meltCooldown = config.MeltConfig.Cooldown;
|
||||||
this.meltSpeed = getConfig().getDouble("Abilities.Water.PhaseChange.Melt.Speed") * night;
|
this.meltSpeed = config.MeltConfig.Speed * night;
|
||||||
this.meltMaxRadius = night * getConfig().getInt("Abilities.Water.PhaseChange.Melt.Radius");
|
this.meltMaxRadius = night * config.MeltConfig.Radius;
|
||||||
this.allowMeltFlow = getConfig().getBoolean("Abilities.Water.PhaseChange.Melt.AllowFlow");
|
this.allowMeltFlow = config.MeltConfig.AllowFlow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,11 +534,11 @@ public class PhaseChange extends IceAbility {
|
||||||
this.depth = value;
|
this.depth = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSourceRange() {
|
public double getSourceRange() {
|
||||||
return this.sourceRange;
|
return this.sourceRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSourceRange(final int value) {
|
public void setSourceRange(final double value) {
|
||||||
this.sourceRange = value;
|
this.sourceRange = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import com.projectkorra.projectkorra.ability.FireAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
|
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterArmsConfig;
|
||||||
import com.projectkorra.projectkorra.firebending.lightning.Lightning;
|
import com.projectkorra.projectkorra.firebending.lightning.Lightning;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||||
|
@ -29,7 +29,8 @@ import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArmsWhip.W
|
||||||
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
|
||||||
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
import com.projectkorra.projectkorra.waterbending.util.WaterReturn;
|
||||||
|
|
||||||
public class WaterArms extends WaterAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class WaterArms extends WaterAbility<WaterArmsConfig> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Arm Enum value for deciding which arm is being used.
|
* Arm Enum value for deciding which arm is being used.
|
||||||
|
@ -53,7 +54,7 @@ public class WaterArms extends WaterAbility {
|
||||||
@Attribute("InitialLength")
|
@Attribute("InitialLength")
|
||||||
private int initLength;
|
private int initLength;
|
||||||
@Attribute(Attribute.SELECT_RANGE)
|
@Attribute(Attribute.SELECT_RANGE)
|
||||||
private int sourceGrabRange;
|
private double sourceGrabRange;
|
||||||
@Attribute("MaxPunches")
|
@Attribute("MaxPunches")
|
||||||
private int maxPunches;
|
private int maxPunches;
|
||||||
@Attribute("MaxIceBlasts")
|
@Attribute("MaxIceBlasts")
|
||||||
|
@ -73,23 +74,23 @@ public class WaterArms extends WaterAbility {
|
||||||
private List<Block> right, left;
|
private List<Block> right, left;
|
||||||
private Set<TempBlock> external;
|
private Set<TempBlock> external;
|
||||||
|
|
||||||
public WaterArms(final Player player) {
|
public WaterArms(final WaterArmsConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.fullSource = true;
|
this.fullSource = true;
|
||||||
this.leftArmConsumed = false;
|
this.leftArmConsumed = false;
|
||||||
this.rightArmConsumed = false;
|
this.rightArmConsumed = false;
|
||||||
this.canUsePlantSource = getConfig().getBoolean("Abilities.Water.WaterArms.Arms.AllowPlantSource");
|
this.canUsePlantSource = config.AllowPlantSource;
|
||||||
this.lightningEnabled = getConfig().getBoolean("Abilities.Water.WaterArms.Arms.Lightning.Enabled");
|
this.lightningEnabled = config.LightningVulnerability;
|
||||||
this.lightningKill = getConfig().getBoolean("Abilities.Water.WaterArms.Arms.Lightning.KillUser");
|
this.lightningKill = config.LightningInstaKill;
|
||||||
this.initLength = getConfig().getInt("Abilities.Water.WaterArms.Arms.InitialLength");
|
this.initLength = config.InitialLength;
|
||||||
this.sourceGrabRange = getConfig().getInt("Abilities.Water.WaterArms.Arms.SourceGrabRange");
|
this.sourceGrabRange = config.SourceGrabRange;
|
||||||
this.maxPunches = getConfig().getInt("Abilities.Water.WaterArms.Arms.MaxAttacks");
|
this.maxPunches = config.MaxAttacks;
|
||||||
this.maxIceBlasts = getConfig().getInt("Abilities.Water.WaterArms.Arms.MaxIceShots");
|
this.maxIceBlasts = config.MaxIceShots;
|
||||||
this.maxUses = getConfig().getInt("Abilities.Water.WaterArms.Arms.MaxAlternateUsage");
|
this.maxUses = config.MaxAlternateUsage;
|
||||||
this.cooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.lightningDamage = getConfig().getDouble("Abilities.Water.WaterArms.Arms.Lightning.Damage");
|
this.lightningDamage = config.LightningDamage;
|
||||||
this.sneakMsg = ConfigManager.languageConfig.get().getString("Abilities.Water.WaterArms.SneakMessage");
|
this.sneakMsg = config.SneakMessage;
|
||||||
this.lengthReduction = 0;
|
this.lengthReduction = 0;
|
||||||
this.selectedSlot = 0;
|
this.selectedSlot = 0;
|
||||||
this.freezeSlot = 4;
|
this.freezeSlot = 4;
|
||||||
|
@ -109,35 +110,35 @@ public class WaterArms extends WaterAbility {
|
||||||
switch (player.getInventory().getHeldItemSlot()) {
|
switch (player.getInventory().getHeldItemSlot()) {
|
||||||
case 0:
|
case 0:
|
||||||
if (player.hasPermission("bending.ability.WaterArms.Pull")) {
|
if (player.hasPermission("bending.ability.WaterArms.Pull")) {
|
||||||
new WaterArmsWhip(player, Whip.PULL);
|
new WaterArmsWhip(config, player, Whip.PULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (player.hasPermission("bending.ability.WaterArms.Punch")) {
|
if (player.hasPermission("bending.ability.WaterArms.Punch")) {
|
||||||
new WaterArmsWhip(player, Whip.PUNCH);
|
new WaterArmsWhip(config, player, Whip.PUNCH);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (player.hasPermission("bending.ability.WaterArms.Grapple")) {
|
if (player.hasPermission("bending.ability.WaterArms.Grapple")) {
|
||||||
new WaterArmsWhip(player, Whip.GRAPPLE);
|
new WaterArmsWhip(config, player, Whip.GRAPPLE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (player.hasPermission("bending.ability.WaterArms.Grab")) {
|
if (player.hasPermission("bending.ability.WaterArms.Grab")) {
|
||||||
new WaterArmsWhip(player, Whip.GRAB);
|
new WaterArmsWhip(config, player, Whip.GRAB);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (player.hasPermission("bending.ability.WaterArms.Freeze") && this.bPlayer.canIcebend()) {
|
if (player.hasPermission("bending.ability.WaterArms.Freeze") && this.bPlayer.canIcebend()) {
|
||||||
new WaterArmsFreeze(player);
|
new WaterArmsFreeze(config, player);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if (player.hasPermission("bending.ability.WaterArms.Spear")) {
|
if (player.hasPermission("bending.ability.WaterArms.Spear")) {
|
||||||
if (this.bPlayer.canIcebend()) {
|
if (this.bPlayer.canIcebend()) {
|
||||||
new WaterArmsSpear(player, true);
|
new WaterArmsSpear(config, player, true);
|
||||||
} else {
|
} else {
|
||||||
new WaterArmsSpear(player, false);
|
new WaterArmsSpear(config, player, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -403,7 +404,7 @@ public class WaterArms extends WaterAbility {
|
||||||
FireAbility.playLightningbendingParticle(l1);
|
FireAbility.playLightningbendingParticle(l1);
|
||||||
}
|
}
|
||||||
if (this.lightningKill) {
|
if (this.lightningKill) {
|
||||||
DamageHandler.damageEntity(this.player, 60D, lightning);
|
DamageHandler.damageEntity(this.player, this.player.getMaxHealth() * 3, lightning);
|
||||||
} else {
|
} else {
|
||||||
DamageHandler.damageEntity(this.player, this.lightningDamage, lightning);
|
DamageHandler.damageEntity(this.player, this.lightningDamage, lightning);
|
||||||
}
|
}
|
||||||
|
@ -695,11 +696,11 @@ public class WaterArms extends WaterAbility {
|
||||||
this.initLength = initLength;
|
this.initLength = initLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSourceGrabRange() {
|
public double getSourceGrabRange() {
|
||||||
return this.sourceGrabRange;
|
return this.sourceGrabRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSourceGrabRange(final int sourceGrabRange) {
|
public void setSourceGrabRange(final double sourceGrabRange) {
|
||||||
this.sourceGrabRange = sourceGrabRange;
|
this.sourceGrabRange = sourceGrabRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,14 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterArmsConfig;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||||
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
|
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
|
||||||
|
|
||||||
public class WaterArmsFreeze extends IceAbility {
|
public class WaterArmsFreeze extends IceAbility<WaterArmsConfig> {
|
||||||
|
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private boolean usageCooldownEnabled;
|
private boolean usageCooldownEnabled;
|
||||||
|
@ -37,13 +38,13 @@ public class WaterArmsFreeze extends IceAbility {
|
||||||
private Vector direction;
|
private Vector direction;
|
||||||
private WaterArms waterArms;
|
private WaterArms waterArms;
|
||||||
|
|
||||||
public WaterArmsFreeze(final Player player) {
|
public WaterArmsFreeze(final WaterArmsConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.usageCooldownEnabled = getConfig().getBoolean("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Enabled");
|
this.usageCooldownEnabled = config.FreezeConfig.UsageCooldownEnabled;
|
||||||
this.iceRange = getConfig().getInt("Abilities.Water.WaterArms.Freeze.Range");
|
this.iceRange = config.FreezeConfig.Range;
|
||||||
this.iceDamage = getConfig().getInt("Abilities.Water.WaterArms.Freeze.Damage");
|
this.iceDamage = config.FreezeConfig.Damage;
|
||||||
this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Freeze");
|
this.usageCooldown = config.FreezeConfig.UsageCooldown;
|
||||||
this.direction = player.getEyeLocation().getDirection();
|
this.direction = player.getEyeLocation().getDirection();
|
||||||
|
|
||||||
this.createInstance();
|
this.createInstance();
|
||||||
|
|
|
@ -19,11 +19,15 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterArmsConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.properties.WaterPropertiesConfig;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
|
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
|
||||||
|
|
||||||
public class WaterArmsSpear extends WaterAbility {
|
@SuppressWarnings({ "deprecation", "unused" })
|
||||||
|
public class WaterArmsSpear extends WaterAbility<WaterArmsConfig> {
|
||||||
|
|
||||||
private static final Map<Block, Long> ICE_BLOCKS = new ConcurrentHashMap<Block, Long>();
|
private static final Map<Block, Long> ICE_BLOCKS = new ConcurrentHashMap<Block, Long>();
|
||||||
|
|
||||||
|
@ -57,24 +61,24 @@ public class WaterArmsSpear extends WaterAbility {
|
||||||
private WaterArms waterArms;
|
private WaterArms waterArms;
|
||||||
private final List<Location> spearLocations;
|
private final List<Location> spearLocations;
|
||||||
|
|
||||||
public WaterArmsSpear(final Player player, final boolean freeze) {
|
public WaterArmsSpear(final WaterArmsConfig config, final Player player, final boolean freeze) {
|
||||||
super(player);
|
super(config, player);
|
||||||
this.canFreeze = freeze;
|
this.canFreeze = freeze;
|
||||||
|
|
||||||
this.usageCooldownEnabled = getConfig().getBoolean("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Enabled");
|
this.usageCooldownEnabled = config.SpearConfig.UsageCooldownEnabled;
|
||||||
this.spearDamageEnabled = getConfig().getBoolean("Abilities.Water.WaterArms.Spear.DamageEnabled");
|
this.spearDamageEnabled = config.SpearConfig.DamageEnabled;
|
||||||
this.spearLength = getConfig().getInt("Abilities.Water.WaterArms.Spear.Length");
|
this.spearLength = config.SpearConfig.Length;
|
||||||
this.spearRange = getConfig().getInt("Abilities.Water.WaterArms.Spear.Range");
|
this.spearRange = config.SpearConfig.RangeDay;
|
||||||
this.spearRangeNight = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Range.Normal");
|
this.spearRangeNight = config.SpearConfig.RangeNight;
|
||||||
this.spearRangeFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Range.FullMoon");
|
this.spearRangeFullMoon = config.SpearConfig.RangeFullMoon;
|
||||||
this.spearSphereRadius = getConfig().getInt("Abilities.Water.WaterArms.Spear.SphereRadius");
|
this.spearSphereRadius = config.SpearConfig.SphereRadiusDay;
|
||||||
this.spearSphereNight = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Sphere.Normal");
|
this.spearSphereNight = config.SpearConfig.SphereRadiusNight;
|
||||||
this.spearSphereFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Spear.NightAugments.Sphere.FullMoon");
|
this.spearSphereFullMoon = config.SpearConfig.SphereRadiusFullMoon;
|
||||||
this.spearDuration = getConfig().getLong("Abilities.Water.WaterArms.Spear.Duration");
|
this.spearDuration = config.SpearConfig.DurationDay;
|
||||||
this.spearDurationNight = getConfig().getLong("Abilities.Water.WaterArms.Spear.NightAugments.Duration.Normal");
|
this.spearDurationNight = config.SpearConfig.DurationNight;
|
||||||
this.spearDurationFullMoon = getConfig().getLong("Abilities.Water.WaterArms.Spear.NightAugments.Duration.FullMoon");
|
this.spearDurationFullMoon = config.SpearConfig.DurationFullMoon;
|
||||||
this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Spear");
|
this.usageCooldown = config.SpearConfig.UsageCooldown;
|
||||||
this.spearDamage = getConfig().getDouble("Abilities.Water.WaterArms.Spear.Damage");
|
this.spearDamage = config.SpearConfig.Damage;
|
||||||
this.spearLocations = new ArrayList<>();
|
this.spearLocations = new ArrayList<>();
|
||||||
|
|
||||||
this.getNightAugments();
|
this.getNightAugments();
|
||||||
|
@ -238,10 +242,10 @@ public class WaterArmsSpear extends WaterAbility {
|
||||||
if (Commands.invincible.contains(((Player) entity).getName())) {
|
if (Commands.invincible.contains(((Player) entity).getName())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerHead") && GeneralMethods.playerHeadIsInBlock((Player) entity, block, true)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerHead && GeneralMethods.playerHeadIsInBlock((Player) entity, block, true)) {
|
||||||
continue ICE_SETTING;
|
continue ICE_SETTING;
|
||||||
}
|
}
|
||||||
if (!getConfig().getBoolean("Properties.Water.FreezePlayerFeet") && GeneralMethods.playerFeetIsInBlock((Player) entity, block, true)) {
|
if (!ConfigManager.getConfig(WaterPropertiesConfig.class).FreezePlayerFeet && GeneralMethods.playerFeetIsInBlock((Player) entity, block, true)) {
|
||||||
continue ICE_SETTING;
|
continue ICE_SETTING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,12 @@ import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
|
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
|
||||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.WaterArmsConfig;
|
||||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
|
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms.Arm;
|
||||||
|
|
||||||
public class WaterArmsWhip extends WaterAbility {
|
public class WaterArmsWhip extends WaterAbility<WaterArmsConfig> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whip Enum value for deciding what ability should be executed.
|
* Whip Enum value for deciding what ability should be executed.
|
||||||
|
@ -67,42 +68,42 @@ public class WaterArmsWhip extends WaterAbility {
|
||||||
private Location end;
|
private Location end;
|
||||||
private WaterArms waterArms;
|
private WaterArms waterArms;
|
||||||
|
|
||||||
public WaterArmsWhip(final Player player, final Whip ability) {
|
public WaterArmsWhip(final WaterArmsConfig config, final Player player, final Whip ability) {
|
||||||
super(player);
|
super(config, player);
|
||||||
|
|
||||||
this.ability = ability;
|
this.ability = ability;
|
||||||
this.reverting = false;
|
this.reverting = false;
|
||||||
this.hasDamaged = false;
|
this.hasDamaged = false;
|
||||||
this.grappled = false;
|
this.grappled = false;
|
||||||
this.grabbed = false;
|
this.grabbed = false;
|
||||||
this.grappleRespectRegions = getConfig().getBoolean("Abilities.Water.WaterArms.Whip.Grapple.RespectRegions");
|
this.grappleRespectRegions = config.WhipConfig.GrappleRespectRegions;
|
||||||
this.usageCooldownEnabled = getConfig().getBoolean("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Enabled");
|
this.usageCooldownEnabled = config.WhipConfig.UsageCooldownEnabled;
|
||||||
this.whipLength = getConfig().getInt("Abilities.Water.WaterArms.Whip.MaxLength");
|
this.whipLength = config.WhipConfig.MaxLengthDay;
|
||||||
this.whipLengthWeak = getConfig().getInt("Abilities.Water.WaterArms.Whip.MaxLengthWeak");
|
this.whipLengthWeak = config.WhipConfig.MaxLengthWeak;
|
||||||
this.whipLengthNight = getConfig().getInt("Abilities.Water.WaterArms.Whip.NightAugments.MaxLength.Normal");
|
this.whipLengthNight = config.WhipConfig.MaxLengthNight;
|
||||||
this.whipLengthFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Whip.NightAugments.MaxLength.FullMoon");
|
this.whipLengthFullMoon = config.WhipConfig.MaxLengthFullMoon;
|
||||||
this.initLength = getConfig().getInt("Abilities.Water.WaterArms.Arms.InitialLength");
|
this.initLength = config.InitialLength;
|
||||||
this.punchLength = getConfig().getInt("Abilities.Water.WaterArms.Whip.Punch.MaxLength");
|
this.punchLength = config.WhipConfig.PunchLengthDay;
|
||||||
this.punchLengthNight = getConfig().getInt("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.Normal");
|
this.punchLengthNight = config.WhipConfig.PunchLengthNight;
|
||||||
this.punchLengthFullMoon = getConfig().getInt("Abilities.Water.WaterArms.Whip.Punch.NightAugments.MaxLength.FullMoon");
|
this.punchLengthFullMoon = config.WhipConfig.PunchLengthFullMoon;
|
||||||
this.activeLength = this.initLength;
|
this.activeLength = this.initLength;
|
||||||
this.whipSpeed = 1;
|
this.whipSpeed = 1;
|
||||||
this.grabDuration = getConfig().getLong("Abilities.Water.WaterArms.Whip.Grab.Duration");
|
this.grabDuration = config.WhipConfig.GrabDuration;
|
||||||
this.pullMultiplier = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Pull.Multiplier");
|
this.pullMultiplier = config.WhipConfig.PullFactor;
|
||||||
this.punchDamage = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Punch.Damage");
|
this.punchDamage = config.WhipConfig.PunchDamage;
|
||||||
|
|
||||||
switch (ability) {
|
switch (ability) {
|
||||||
case PULL:
|
case PULL:
|
||||||
this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Pull");
|
this.usageCooldown = config.WhipConfig.UsageCooldownPull;
|
||||||
break;
|
break;
|
||||||
case PUNCH:
|
case PUNCH:
|
||||||
this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Punch");
|
this.usageCooldown = config.WhipConfig.UsageCooldownPunch;
|
||||||
break;
|
break;
|
||||||
case GRAPPLE:
|
case GRAPPLE:
|
||||||
this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Grapple");
|
this.usageCooldown = config.WhipConfig.UsageCooldownGrapple;
|
||||||
break;
|
break;
|
||||||
case GRAB:
|
case GRAB:
|
||||||
this.usageCooldown = getConfig().getLong("Abilities.Water.WaterArms.Arms.Cooldowns.UsageCooldown.Grab");
|
this.usageCooldown = config.WhipConfig.UsageCooldownGrab;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.usageCooldown = 200;
|
this.usageCooldown = 200;
|
||||||
|
|
|
@ -6,19 +6,20 @@ import org.bukkit.entity.Player;
|
||||||
import com.projectkorra.projectkorra.ability.CoreAbility;
|
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||||
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.FastSwimConfig;
|
||||||
import com.projectkorra.projectkorra.earthbending.EarthArmor;
|
import com.projectkorra.projectkorra.earthbending.EarthArmor;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterSpout;
|
import com.projectkorra.projectkorra.waterbending.WaterSpout;
|
||||||
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms;
|
import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArms;
|
||||||
|
|
||||||
public class FastSwim extends WaterAbility implements PassiveAbility {
|
public class FastSwim extends WaterAbility<FastSwimConfig> implements PassiveAbility {
|
||||||
|
|
||||||
private long cooldown;
|
private long cooldown;
|
||||||
private double swimSpeed;
|
private double swimSpeed;
|
||||||
private long duration;
|
private long duration;
|
||||||
|
|
||||||
public FastSwim(final Player player) {
|
public FastSwim(final FastSwimConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
if (this.bPlayer.isOnCooldown(this)) {
|
if (this.bPlayer.isOnCooldown(this)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +28,9 @@ public class FastSwim extends WaterAbility implements PassiveAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cooldown = ConfigManager.getConfig().getLong("Abilities.Water.Passive.FastSwim.Cooldown");
|
this.cooldown = config.Cooldown;
|
||||||
this.swimSpeed = ConfigManager.getConfig().getDouble("Abilities.Water.Passive.FastSwim.SpeedFactor");
|
this.swimSpeed = config.SpeedFactor;
|
||||||
this.duration = ConfigManager.getConfig().getLong("Abilities.Water.Passive.FastSwim.Duration");
|
this.duration = config.Duration;
|
||||||
|
|
||||||
this.start();
|
this.start();
|
||||||
}
|
}
|
||||||
|
@ -60,7 +61,7 @@ public class FastSwim extends WaterAbility implements PassiveAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getSwimSpeed() {
|
public static double getSwimSpeed() {
|
||||||
return ConfigManager.getConfig().getDouble("Abilities.Water.Passive.FastSwim.SpeedFactor");
|
return ConfigManager.getConfig(FastSwimConfig.class).SpeedFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,16 +10,18 @@ import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
import com.projectkorra.projectkorra.ability.PassiveAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.command.Commands;
|
import com.projectkorra.projectkorra.command.Commands;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.HydroSinkConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.properties.GeneralPropertiesConfig;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
|
|
||||||
public class HydroSink extends WaterAbility implements PassiveAbility {
|
public class HydroSink extends WaterAbility<HydroSinkConfig> implements PassiveAbility {
|
||||||
public HydroSink(final Player player) {
|
public HydroSink(final HydroSinkConfig config, final Player player) {
|
||||||
super(player);
|
super(config, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean applyNoFall(final Player player) {
|
public static boolean applyNoFall(final Player player) {
|
||||||
if (Commands.isToggledForAll && ConfigManager.defaultConfig.get().getBoolean("Properties.TogglePassivesWithAllBending")) {
|
if (Commands.isToggledForAll && ConfigManager.getConfig(GeneralPropertiesConfig.class).TogglePassivesWithAllBending) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,11 @@ import org.bukkit.entity.Player;
|
||||||
import com.projectkorra.projectkorra.GeneralMethods;
|
import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.PlantAbility;
|
import com.projectkorra.projectkorra.ability.PlantAbility;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.EmptyAbilityConfig;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.properties.WaterPropertiesConfig;
|
||||||
|
|
||||||
public class PlantRegrowth extends PlantAbility {
|
public class PlantRegrowth extends PlantAbility<EmptyAbilityConfig> {
|
||||||
|
|
||||||
private BlockData data;
|
private BlockData data;
|
||||||
private long time;
|
private long time;
|
||||||
|
@ -20,9 +23,9 @@ public class PlantRegrowth extends PlantAbility {
|
||||||
private Block block;
|
private Block block;
|
||||||
|
|
||||||
public PlantRegrowth(final Player player, final Block block) {
|
public PlantRegrowth(final Player player, final Block block) {
|
||||||
super(player);
|
super(new EmptyAbilityConfig(), player);
|
||||||
|
|
||||||
this.regrowTime = getConfig().getLong("Abilities.Water.Plantbending.RegrowTime");
|
this.regrowTime = ConfigManager.getConfig(WaterPropertiesConfig.class).PlantRegrowTime;
|
||||||
if (this.regrowTime != 0) {
|
if (this.regrowTime != 0) {
|
||||||
this.block = block;
|
this.block = block;
|
||||||
this.type = block.getType();
|
this.type = block.getType();
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.GeneralMethods;
|
import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
|
import com.projectkorra.projectkorra.configuration.better.configs.abilities.EmptyAbilityConfig;
|
||||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
import com.projectkorra.projectkorra.waterbending.OctopusForm;
|
import com.projectkorra.projectkorra.waterbending.OctopusForm;
|
||||||
|
@ -22,7 +23,8 @@ import com.projectkorra.projectkorra.waterbending.SurgeWall;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
||||||
import com.projectkorra.projectkorra.waterbending.ice.IceSpikeBlast;
|
import com.projectkorra.projectkorra.waterbending.ice.IceSpikeBlast;
|
||||||
|
|
||||||
public class WaterReturn extends WaterAbility {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class WaterReturn extends WaterAbility<EmptyAbilityConfig> {
|
||||||
|
|
||||||
private long time;
|
private long time;
|
||||||
private long interval;
|
private long interval;
|
||||||
|
@ -31,7 +33,7 @@ public class WaterReturn extends WaterAbility {
|
||||||
private TempBlock block;
|
private TempBlock block;
|
||||||
|
|
||||||
public WaterReturn(final Player player, final Block block) {
|
public WaterReturn(final Player player, final Block block) {
|
||||||
super(player);
|
super(new EmptyAbilityConfig(), player);
|
||||||
if (hasAbility(player, WaterReturn.class)) {
|
if (hasAbility(player, WaterReturn.class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import com.projectkorra.projectkorra.ability.ElementalAbility;
|
||||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class WaterSourceGrabber {
|
public class WaterSourceGrabber {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue