diff --git a/.gitignore b/.gitignore index 9cf427c9..896e76f6 100644 --- a/.gitignore +++ b/.gitignore @@ -38,9 +38,4 @@ Icon .Trashes bin/ -*.classpath -.idea/.name -*.xml -*.class -*.class -ProjectKorra.iml \ No newline at end of file +*.classpath \ No newline at end of file diff --git a/src/com/projectkorra/ProjectKorra/ConfigManager.java b/src/com/projectkorra/ProjectKorra/ConfigManager.java index a63a346a..dafee7f2 100644 --- a/src/com/projectkorra/ProjectKorra/ConfigManager.java +++ b/src/com/projectkorra/ProjectKorra/ConfigManager.java @@ -65,7 +65,6 @@ public class ConfigManager { config.addDefault("Properties.BendingAffectFallingSand.TNTStrengthMultiplier", 1.0); config.addDefault("Properties.GlobalCooldown", 500); config.addDefault("Properties.SeaLevel", 62); - config.addDefault("Properties.HorizontalCollisionPhysics.WallDamageMinimumDistance", 5.0); config.addDefault("Properties.CustomItems.GrapplingHook.Enable", true); config.addDefault("Properties.CustomItems.GrapplingHook.IronUses", 25); diff --git a/src/com/projectkorra/ProjectKorra/Objects/HorizontalVelocityTracker.java b/src/com/projectkorra/ProjectKorra/Objects/HorizontalVelocityTracker.java index 05917b77..2e0dc373 100644 --- a/src/com/projectkorra/ProjectKorra/Objects/HorizontalVelocityTracker.java +++ b/src/com/projectkorra/ProjectKorra/Objects/HorizontalVelocityTracker.java @@ -3,7 +3,6 @@ package com.projectkorra.ProjectKorra.Objects; import com.projectkorra.ProjectKorra.Methods; import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.Utilities.HorizontalVelocityChangeEvent; -import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -25,8 +24,6 @@ public class HorizontalVelocityTracker private Player instigator; private Vector lastVelocity; private Vector thisVelocity; - private Location launchLocation; - private Location impactLocation; public HorizontalVelocityTracker(Entity e, Player instigator, long delay) { @@ -34,9 +31,7 @@ public class HorizontalVelocityTracker this.instigator = instigator; fireTime = System.currentTimeMillis(); this.delay = delay; - thisVelocity = e.getVelocity().clone(); - launchLocation = e.getLocation().clone(); - impactLocation = launchLocation.clone(); + thisVelocity = e.getVelocity(); this.delay = delay; update(); instances.put(entity, this); @@ -74,12 +69,11 @@ public class HorizontalVelocityTracker if((diff.getX() > 1 || diff.getX() < -1) || (diff.getZ() > 1 || diff.getZ() < -1)) { - impactLocation = entity.getLocation(); - for (Block b : blocks) + for(Block b : blocks) { - if (!Methods.isTransparentToEarthbending(instigator, b)) + if(!Methods.isTransparentToEarthbending(instigator, b)) { - ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity, instigator, lastVelocity, thisVelocity, diff, launchLocation, impactLocation)); + ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity, instigator, lastVelocity, thisVelocity, diff)); remove(); return; } diff --git a/src/com/projectkorra/ProjectKorra/PKListener.java b/src/com/projectkorra/ProjectKorra/PKListener.java index 57b631e6..fea38e14 100644 --- a/src/com/projectkorra/ProjectKorra/PKListener.java +++ b/src/com/projectkorra/ProjectKorra/PKListener.java @@ -13,7 +13,10 @@ import com.projectkorra.ProjectKorra.earthbending.LavaFlow.AbilityType; import com.projectkorra.ProjectKorra.firebending.*; import com.projectkorra.ProjectKorra.firebending.Fireball; import com.projectkorra.ProjectKorra.waterbending.*; -import org.bukkit.*; +import org.bukkit.ChatColor; +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.*; import org.bukkit.event.EventHandler; @@ -68,9 +71,7 @@ public class PKListener implements Listener { { if(e.getEntity().getEntityId() != e.getInstigator().getEntityId()) { - double minimumDistance = plugin.getConfig().getDouble("Properties.HorizontalCollisionPhysics.WallDamageMinimumDistance"); - double damage = ((e.getDistanceTravelled() - minimumDistance) < 0 ? 0 : e.getDistanceTravelled() - minimumDistance) / (e.getDifference().length()); - Methods.damageEntity(e.getInstigator(), e.getEntity(), damage); + Methods.damageEntity(e.getInstigator(), e.getEntity(), e.getDifference().length() * 2); } } } diff --git a/src/com/projectkorra/ProjectKorra/Utilities/HorizontalVelocityChangeEvent.java b/src/com/projectkorra/ProjectKorra/Utilities/HorizontalVelocityChangeEvent.java index d3aa8d97..61de98d8 100644 --- a/src/com/projectkorra/ProjectKorra/Utilities/HorizontalVelocityChangeEvent.java +++ b/src/com/projectkorra/ProjectKorra/Utilities/HorizontalVelocityChangeEvent.java @@ -1,6 +1,5 @@ package com.projectkorra.ProjectKorra.Utilities; -import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; @@ -22,10 +21,7 @@ public class HorizontalVelocityChangeEvent extends Event implements Cancellable private Vector from; private Vector to; private Vector difference; - private Location start; - private Location end; - @Deprecated public HorizontalVelocityChangeEvent(Entity entity, Player instigator, Vector from, Vector to, Vector difference) { this.entity = entity; @@ -35,17 +31,6 @@ public class HorizontalVelocityChangeEvent extends Event implements Cancellable this.difference = difference; } - public HorizontalVelocityChangeEvent(Entity entity, Player instigator, Vector from, Vector to, Vector difference, Location start, Location end) - { - this.entity = entity; - this.instigator = instigator; - this.from = from; - this.to = to; - this.difference = difference; - this.start = start; - this.end = end; - } - public Entity getEntity() { return entity; @@ -66,21 +51,6 @@ public class HorizontalVelocityChangeEvent extends Event implements Cancellable return to; } - public Location getStartPoint() - { - return start; - } - - public Location getEndPoint() - { - return end; - } - - public double getDistanceTravelled() - { - return start.distance(end); - } - public Vector getDifference() { return difference;