Fix issue #635
Menu entry shop swapper should now work. This checks if the option is value and checks if buy/sell is active so both values for buying and selling don't conflict with each other
This commit is contained in:
@@ -32,6 +32,7 @@ import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -604,7 +605,10 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (option.contains("buy"))
|
||||
if ((option.contains("buy") || option.contains("value")) && Arrays.stream(entries).anyMatch(menuEntry ->
|
||||
{
|
||||
return menuEntry.getOption().toLowerCase().contains("buy");
|
||||
}))
|
||||
{
|
||||
if (config.getSwapBuyOne() && !config.getBuyOneItems().equals(""))
|
||||
{
|
||||
@@ -650,7 +654,10 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (option.contains("sell"))
|
||||
else if ((option.contains("sell") || option.contains("value")) && Arrays.stream(entries).anyMatch(menuEntry ->
|
||||
{
|
||||
return menuEntry.getOption().toLowerCase().contains("sell");
|
||||
}))
|
||||
{
|
||||
if (config.getSwapSellOne() && !config.getSellOneItems().equals(""))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user