mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-05-15 17:31:26 +00:00
102112ffdd
## Fixes * Fixed Combos and possibly Passives appearing in `/pk b <Ability>` auto-tabbing. * Fixed Combos not loading properly on certain servers. * Fixed issue with `PreciousStones` by updating to the latest version to resolve API change issues. * Fixed `RapidPunch` damage. * Fixed incorrect summation of chiblocking chance. * Fixed possible issue in PKListener#onPlayerInteraction() * Fixed `Earth.LavaSound`. * Fixed Chi attempting to chiblock targets with any move. * Fixed hitting an entity with `TempArmor` not ignoring armor. * Fixed `Immobilize` config path. ## Additions * Added "Contributing" section to the `README` to help guide active community members. * Added more detail to the `PULL_REQUEST_TEMPLATE` to allow for more uniform pull requests. * Added many new blocks to our ability block interaction. * Added check to combo collisions to discard dead entities. * Added functionality to allow chiblocking abilities to affect all entities. * Added exception handling to the configurable `Sound` options to prevent `IllegalArgumentExcpetions`. * Added sounds and `ActionBar` messages to being Bloodbent, Electrocuted, Immobilized, MetalClipped, and Paralyzed. (Abilities: `Bloodbending`, `Lightning`, `Immobilize`, `MetalClips`, and `Paralyze`) * Added sound and `ActionBar` message for being Chiblocked. * Added interval config option to `RapidPunch`. (time between each punch) ## API Changes * Updated to `Spigot 1.12.1`. * Confirmed to be backward compatible with `Spigot 1.12` and `Spigot 1.11.2`. * Renamed `ElementalAbility#getTransparentMaterial()` to `ElementalAbility#getTransparentMaterials()`. * Converted most `byte`/`int` dependent `Material` logic to use `Material` instead. * `ElementalAbility#getTransparentMaterialSet()` now returns a `HashSet<Material>` instead of a `HashSet<Byte>`. * `ElementalAbility#getTransparentMaterials()` and `GeneralMethods.NON_OPAQUE` now return `Material[]` instead of `Integer[]`. * `GeneralMethods#getTargetedLocation()` now takes a `varargs Material[]` instead of a `varargs Integer[]`. * Removed `ElementalAbility.TRANSPARENT_MATERIAL`. It was outdated and became irrelevent after `GeneralMethods.NON_OPAQUE` was updated. * Removed `Java 7` Travi-CI JDK check. * Updated `pom.xml` to build in `Java 8`. * Added new `MovementHandler` utility class to control entity movement. (currently only capable of stopping movement.
57 lines
1.5 KiB
Java
57 lines
1.5 KiB
Java
package com.projectkorra.projectkorra.ability;
|
|
|
|
import com.projectkorra.projectkorra.Element;
|
|
import com.projectkorra.projectkorra.ProjectKorra;
|
|
|
|
import org.bukkit.Location;
|
|
import org.bukkit.Sound;
|
|
import org.bukkit.entity.Player;
|
|
|
|
public abstract class AvatarAbility extends ElementalAbility {
|
|
|
|
public AvatarAbility(Player player) {
|
|
super(player);
|
|
}
|
|
|
|
@Override
|
|
public boolean isIgniteAbility() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean isExplosiveAbility() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public final Element getElement() {
|
|
return Element.AVATAR;
|
|
}
|
|
|
|
public static void playAvatarSound(Location loc) {
|
|
if (getConfig().getBoolean("Abilities.Avatar.AvatarState.PlaySound")) {
|
|
float volume = (float) getConfig().getDouble("Abilities.Avatar.AvatarState.Sound.Volume");
|
|
float pitch = (float) getConfig().getDouble("Abilities.Avatar.AvatarState.Sound.Pitch");
|
|
|
|
Sound sound = Sound.BLOCK_ANVIL_LAND;
|
|
|
|
try {
|
|
sound = Sound.valueOf(getConfig().getString("Properties.Avatar.AvatarState.Sound.Sound"));
|
|
} catch (IllegalArgumentException exception) {
|
|
ProjectKorra.log.warning("Your current value for 'Properties.Avatar.AvatarState.Sound.Sound' is not valid.");
|
|
} finally {
|
|
loc.getWorld().playSound(loc, sound, volume, pitch);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Determines whether the ability requires the user to be an avatar in order
|
|
* to be able to use it. Set this to <tt>false</tt> for moves that should be
|
|
* able to be used without players needing to have the avatar element
|
|
*/
|
|
public boolean requireAvatar() {
|
|
return true;
|
|
}
|
|
|
|
} |