mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2025-02-16 20:32:41 +01:00
Fixed sea bounce.
This commit is contained in:
parent
f6a52a4290
commit
8b68cea6a1
@ -60,6 +60,15 @@ public class AcidEffect implements Listener {
|
||||
wetPlayers.remove(e.getEntity());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onSeaBounce(PlayerMoveEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
if (!player.getGameMode().equals(GameMode.CREATIVE) && !player.getGameMode().equals(GameMode.SPECTATOR)
|
||||
&& player.getWorld().equals(addon.getIslandWorld()) && player.getLocation().getBlockY() < 1) {
|
||||
player.setVelocity(new Vector(player.getVelocity().getX(), 1D, player.getVelocity().getZ()));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPlayerMove(PlayerMoveEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
@ -67,7 +76,7 @@ public class AcidEffect implements Listener {
|
||||
if ((addon.getSettings().getAcidRainDamage() == 0 && addon.getSettings().getAcidDamage() == 0)
|
||||
|| player.isDead()
|
||||
|| player.getGameMode().equals(GameMode.CREATIVE)
|
||||
|| player.getGameMode().toString().startsWith("SPECTATOR")
|
||||
|| player.getGameMode().equals(GameMode.SPECTATOR)
|
||||
|| addon.getPlayers().isInTeleport(player.getUniqueId())
|
||||
|| !player.getWorld().equals(addon.getIslandWorld())
|
||||
|| player.hasPermission("acidisland.mod.noburn")
|
||||
@ -112,13 +121,6 @@ public class AcidEffect implements Listener {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Find out if they are at the bottom of the sea and if so bounce them
|
||||
// back up
|
||||
if (playerLoc.getBlockY() < 1) {
|
||||
final Vector v = new Vector(player.getVelocity().getX(), 1D, player.getVelocity().getZ());
|
||||
player.setVelocity(v);
|
||||
}
|
||||
// If they are already burning in acid then return
|
||||
if (burningPlayers.contains(player)) {
|
||||
// plugin.getLogger().info("DEBUG: no acid water is false");
|
||||
|
Loading…
Reference in New Issue
Block a user