Merge pull request #11603 from loldudester/anti-drag-pvp-enable

antidrag: Enable shift-antidrag in PvP regardless of onShiftOnly config
This commit is contained in:
Jordan
2020-06-02 19:49:52 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ public interface AntiDragConfig extends Config
@ConfigItem(
keyName = "onShiftOnly",
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
)
default boolean onShiftOnly()

View File

@@ -112,7 +112,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener
@Override
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly())
if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly()))
{
setDragDelay();
held = true;
@@ -122,7 +122,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener
@Override
public void keyReleased(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly())
if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly()))
{
resetDragDelay();
held = false;