Added ability to change mouse speed when locked
This commit is contained in:
parent
ece6a6aac0
commit
d3b7adf2ae
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
public class MouseLockerPlayerListener implements Listener
|
public class MouseLockerPlayerListener implements Listener
|
||||||
{
|
{
|
||||||
public static List<Player> LockedPlayers = new List<Player>();
|
public static List<Player> LockedPlayers = new List<Player>();
|
||||||
|
public static int LockedSpeed=1;
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerMoveMouse(PlayerMoveEvent e)
|
public void onPlayerMoveMouse(PlayerMoveEvent e)
|
||||||
|
@ -18,8 +19,8 @@ public class MouseLockerPlayerListener implements Listener
|
||||||
float yaw2 = e.getTo().getYaw();
|
float yaw2 = e.getTo().getYaw();
|
||||||
float pitch2 = e.getTo().getPitch();
|
float pitch2 = e.getTo().getPitch();
|
||||||
|
|
||||||
PluginMain.Instance.UpdateMouse(null, (int) (yaw2 - yaw1),
|
PluginMain.Instance.UpdateMouse(null, (int) ((yaw2 - yaw1)*LockedSpeed),
|
||||||
(int) (pitch2 - pitch1), 0, 0, "");
|
(int) ((pitch2 - pitch1)*LockedSpeed), 0, 0, "");
|
||||||
|
|
||||||
e.setTo(e.getFrom());
|
e.setTo(e.getFrom());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue