menuentryswapper: Don't add swaps without a target
This commit is contained in:
@@ -43,7 +43,6 @@ import java.util.Set;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.InventoryID;
|
import net.runelite.api.InventoryID;
|
||||||
@@ -112,7 +111,6 @@ import org.apache.commons.lang3.ArrayUtils;
|
|||||||
)
|
)
|
||||||
@Singleton
|
@Singleton
|
||||||
@PluginDependency(PvpToolsPlugin.class)
|
@PluginDependency(PvpToolsPlugin.class)
|
||||||
@Slf4j
|
|
||||||
public class MenuEntrySwapperPlugin extends Plugin
|
public class MenuEntrySwapperPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final String CONFIG_GROUP = "shiftclick";
|
private static final String CONFIG_GROUP = "shiftclick";
|
||||||
@@ -491,8 +489,6 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
|
|
||||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||||
{
|
{
|
||||||
log.info(String.valueOf(event));
|
|
||||||
|
|
||||||
if (client.getGameState() != GameState.LOGGED_IN)
|
if (client.getGameState() != GameState.LOGGED_IN)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -1686,6 +1682,12 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
|
|
||||||
for (Map.Entry<String, String> entry : split.entrySet())
|
for (Map.Entry<String, String> entry : split.entrySet())
|
||||||
{
|
{
|
||||||
|
String val = entry.getValue();
|
||||||
|
if (!val.contains(","))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
sb.append(entry.getValue()).append(":0\n");
|
sb.append(entry.getValue()).append(":0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user