Merge pull request #285 from OmniCypher-/master

Fixes
This commit is contained in:
OmniCypher 2015-11-07 22:09:59 -08:00
commit f025631a17
2 changed files with 5 additions and 4 deletions

View file

@ -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!");

View file

@ -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();