Skip to content

Commit

Permalink
Merge pull request #183 from OSRSB/cleanup
Browse files Browse the repository at this point in the history
Fix recent update breaking the client
  • Loading branch information
GigiaJ authored Apr 27, 2022
2 parents b19cc30 + cd3bb9a commit a265932
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
mavenCentral()
}

def runeLiteVersion = '1.8.16'
def runeLiteVersion = '1.8.18.4'

dependencies {
implementation group: 'net.runelite', name: 'client', version: runeLiteVersion
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/rsb/botLauncher/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ public static void main(final String[] args) throws Throwable {
OptionSet options = parser.parse(args);
programArgs = args;

checkForCacheAndLoad();

if (!options.has("bot") || options.has("bot-runelite") || options.has("runelite")) {
if (options.has("bot-runelite") && !options.has("runelite")) {
checkForCacheAndLoad();
RuneLite bot = new RuneLite();
bot.launch(parser, optionSpecs, options);
addBot(bot);
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/rsb/internal/BotModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ public BotModule(OkHttpClient okHttpClient, Supplier<Applet> clientLoader, Suppl
@Override
protected void configure()
{
// bind properties
Properties properties = BotProperties.getProperties();
for (String key : properties.stringPropertyNames())
{
String value = properties.getProperty(key);
bindConstant().annotatedWith(Names.named(key)).to(value);
}

// bind runtime config
RuntimeConfig runtimeConfig = configSupplier.get();
if (runtimeConfig != null && runtimeConfig.getProps() != null)
{
Expand All @@ -71,13 +74,13 @@ protected void configure()
else if (entry.getValue() instanceof Double)
{
ConstantBindingBuilder binder = bindConstant().annotatedWith(Names.named(entry.getKey()));
if (DoubleMath.isMathematicalInteger((Double) entry.getValue()))
if (DoubleMath.isMathematicalInteger((double) entry.getValue()))
{
binder.to(((Double) entry.getValue()).intValue());
binder.to((int) (double) entry.getValue());
}
else
{
binder.to((Double) entry.getValue());
binder.to((double) entry.getValue());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rsb/plugin/BotPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BotPanel extends PluginPanel


@Inject
private BotPanel(ClientThread clientThread, ItemManager itemManager, ScheduledExecutorService executor)
private BotPanel()
{
super(false);
setLayout(new BorderLayout());
Expand Down

0 comments on commit a265932

Please sign in to comment.