Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerMove(PlayerMoveEvent e){
- Player p = e.getPlayer();
- Vector v = p.getVelocity();
- Location l1 = p.getLocation();
- Location l2 = new Location(l1.getWorld(), l1.getX(), l1.getY()-1, l1.getZ());
- double yaw = Math.toRadians(p.getLocation().getYaw()+90);
- double pitch = Math.toRadians(-p.getLocation().getPitch());
- double x = 0*Math.cos(yaw)*Math.cos(pitch);
- double z = 0*Math.sin(pitch);
- double y = 1*Math.sin(yaw)*Math.cos(pitch);
- double q = 25*Math.sin(yaw)*Math.cos(pitch);
- double w = (q*0)+1.0;
- double m = l1.getY();
- double j = (m*0)+1;
- if(l2.getBlock().getType()==Material.IRON_BLOCK){
- if (j == 1 || y == 0){
- p.setVelocity(new Vector(x,j,z));
- }
- if (j >= 25||y >= 25){
- p.setVelocity(new Vector(x,w,z));
- }
- if (j < 25 || y < 25){
- if (l2.getBlock().getType() ==Material.IRON_BLOCK);
- p.setVelocity(new Vector(x,y,z));
- }
- }
- if (p.isSneaking()) {
- p.setVelocity(new Vector (0,0,0));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement