antidrag: Enable shift-antidrag in PvP regardless of onShiftOnly config

This commit is contained in:
loldudester
2020-05-15 04:31:48 +01:00
parent 37760c9775
commit 5e4cded98d
2 changed files with 3 additions and 3 deletions

View File

@@ -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()

View File

@@ -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;