mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Fixes
Fixes Clear arguments Fixes Velocity Damage
This commit is contained in:
parent
74e4f1bcb6
commit
33e63d1bc3
2 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
|
|||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.multiability.MultiAbilityManager;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -21,7 +22,7 @@ public class ClearCommand extends PKCommand {
|
|||
|
||||
@Override
|
||||
public void execute(CommandSender sender, List<String> args) {
|
||||
if (!hasPermission(sender) || !correctLength(sender, args.size(), 0, 0) || !isPlayer(sender)) {
|
||||
if (!hasPermission(sender) || !correctLength(sender, args.size(), 0, 1) || !isPlayer(sender)) {
|
||||
return;
|
||||
} else if (MultiAbilityManager.hasMultiAbilityBound((Player) sender)) {
|
||||
sender.sendMessage(ChatColor.RED + "You can't edit your binds right now!");
|
||||
|
|
|
@ -46,8 +46,9 @@ public class HorizontalVelocityTracker {
|
|||
}
|
||||
|
||||
public void update() {
|
||||
if (System.currentTimeMillis() < fireTime + delay)
|
||||
if (System.currentTimeMillis() < fireTime + delay) {
|
||||
return;
|
||||
}
|
||||
|
||||
lastVelocity = thisVelocity.clone();
|
||||
thisVelocity = entity.getVelocity().clone();
|
||||
|
@ -67,12 +68,11 @@ public class HorizontalVelocityTracker {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (thisVelocity.length() < lastVelocity.length()) {
|
||||
if ((diff.getX() > 1 || diff.getX() < -1) || (diff.getZ() > 1 || diff.getZ() < -1)) {
|
||||
impactLocation = entity.getLocation();
|
||||
for (Block b : blocks) {
|
||||
if (GeneralMethods.isSolid(b) && (entity.getLocation().getBlock().getRelative(BlockFace.EAST) == b || entity.getLocation().getBlock().getRelative(BlockFace.NORTH) == b || entity.getLocation().getBlock().getRelative(BlockFace.WEST) == b || entity.getLocation().getBlock().getRelative(BlockFace.SOUTH) == b)) {
|
||||
if (GeneralMethods.isSolid(b) && (entity.getLocation().getBlock().getRelative(BlockFace.EAST, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.NORTH, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.WEST, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.SOUTH, 1).equals(b))) {
|
||||
if (!EarthMethods.isTransparentToEarthbending(instigator, b)) {
|
||||
ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity, instigator, lastVelocity, thisVelocity, diff, launchLocation, impactLocation));
|
||||
remove();
|
||||
|
|
Loading…
Reference in a new issue