Fix AirScooter

- Fixed AirScooter users being launched up by water when going through a
standing wall of water.
- Also makes imports match importorder
This commit is contained in:
Benford 2015-11-14 03:50:45 -05:00
parent 10c8afcb4d
commit 8bbb331953

View file

@ -1,7 +1,9 @@
package com.projectkorra.projectkorra.airbending; package com.projectkorra.projectkorra.airbending;
import java.util.ArrayList; import com.projectkorra.projectkorra.GeneralMethods;
import java.util.concurrent.ConcurrentHashMap; import com.projectkorra.projectkorra.configuration.ConfigLoadable;
import com.projectkorra.projectkorra.util.Flight;
import com.projectkorra.projectkorra.waterbending.WaterMethods;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -10,9 +12,8 @@ import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods; import java.util.ArrayList;
import com.projectkorra.projectkorra.configuration.ConfigLoadable; import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.util.Flight;
public class AirScooter implements ConfigLoadable { public class AirScooter implements ConfigLoadable {
@ -155,7 +156,10 @@ public class AirScooter implements ConfigLoadable {
velocity.setY(0); velocity.setY(0);
} }
Location loc = player.getLocation(); Location loc = player.getLocation();
loc.setY((double) floorblock.getY() + 1.5); if (!WaterMethods.isWater(player.getLocation().add(0, 2, 0).getBlock()))
loc.setY((double) floorblock.getY() + 1.5);
else
return false;
// player.setFlying(true); // player.setFlying(true);
// player.teleport(loc.add(velocity)); // player.teleport(loc.add(velocity));
player.setSprinting(false); player.setSprinting(false);