Move jump stuff to AnuraJump

This commit is contained in:
kaenganxt
2014-10-26 19:05:07 +01:00
parent 2f65c566ae
commit ba421aa4bc
2 changed files with 3 additions and 33 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/build/
/dist/

View File

@@ -2,13 +2,10 @@ package de.anura.core;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Entity;
import org.bukkit.material.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -29,36 +26,7 @@ public class PlayerMove implements Listener
{
Player p = event.getPlayer();
Block block = event.getTo().clone().getBlock();
Block under = block.getLocation().subtract(0,1,0).getBlock();
Location jumpIslandCenter = new Location(Bukkit.getWorld("lobby"), -289, 60, -1438);
if(p.getWorld().getName().equals("lobby") && jumpIslandCenter.distance(event.getTo()) < 80 && (under.getType().equals(Material.GRASS)) && ((Entity)p).isOnGround() && !p.hasPermission("core.jump.grassStep"))
{
ResultSet rs = AnuraCore.getSql().querySelect("SELECT x,y,z FROM jumpLocs WHERE stage = (SELECT stage FROM jumpUsers WHERE userId = (SELECT id FROM players WHERE uuid = '"+p.getUniqueId().toString()+"') ORDER BY stage DESC LIMIT 1)");
try {
if(!rs.first())
{
Location loc = new Location(Bukkit.getWorld("lobby"), -262, 19, -1473);
p.teleport(loc);
return;
}
double x = rs.getInt("x");
double y = rs.getInt("y");
double z = rs.getInt("z");
if(x<0) x -= 0.5;
else x += 0.5;
if(z<0) z -= 0.5;
else z += 0.5;
Location loc = new Location(Bukkit.getWorld("lobby"), x, y, z);
p.teleport(loc);
API.statusMsg(p, "jump_tp_last_grass", true);
}
catch(SQLException e)
{
System.out.println(e.getLocalizedMessage());
}
}
Block under = block.getLocation().subtract(0,1,0).getBlock();
if(event.getTo().getY() <= -40 && plugin.getConfig().getBoolean("no-void-death"))
{