antidrag: Enable shift-antidrag in PvP regardless of onShiftOnly config
This commit is contained in:
@@ -46,7 +46,7 @@ public interface AntiDragConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "onShiftOnly",
|
keyName = "onShiftOnly",
|
||||||
name = "On Shift Only",
|
name = "On Shift Only",
|
||||||
description = "Configures whether to only adjust the delay while holding shift. Required for anti drag in PvP scenarios.",
|
description = "Configures whether to only adjust the delay while holding shift in non-PvP scenarios. Shift is required in PvP regardless of this config setting",
|
||||||
position = 2
|
position = 2
|
||||||
)
|
)
|
||||||
default boolean onShiftOnly()
|
default boolean onShiftOnly()
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener
|
|||||||
@Override
|
@Override
|
||||||
public void keyPressed(KeyEvent e)
|
public void keyPressed(KeyEvent e)
|
||||||
{
|
{
|
||||||
if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly())
|
if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly()))
|
||||||
{
|
{
|
||||||
setDragDelay();
|
setDragDelay();
|
||||||
held = true;
|
held = true;
|
||||||
@@ -122,7 +122,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener
|
|||||||
@Override
|
@Override
|
||||||
public void keyReleased(KeyEvent e)
|
public void keyReleased(KeyEvent e)
|
||||||
{
|
{
|
||||||
if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly())
|
if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly()))
|
||||||
{
|
{
|
||||||
resetDragDelay();
|
resetDragDelay();
|
||||||
held = false;
|
held = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user