Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 2f0361a

Browse files
committed
Fixed username bug
Stats#getUsername was null
1 parent d2f7821 commit 2f0361a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ sourceCompatibility = 1.8
88

99
repositories {
1010
mavenCentral()
11+
maven { url 'https://jitpack.io' }
1112
}
1213

1314
dependencies {
@@ -17,6 +18,7 @@ dependencies {
1718
compile group: 'org.json', name: 'json', version: '20090211'
1819
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
1920
compileOnly 'org.projectlombok:lombok:1.16.20'
21+
compile 'net.olympiccode:vHackOSAPI-Java:dev-SNAPSHOT'
2022
}
2123

2224
shadowJar.destinationDir = file("/build/libs")

src/main/java/examples/BrainStormExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static void main(String[] args) {
5151
// api.getAppManager().getApp(AppType.Spam).getAsUpdateable().fillTasks();
5252
int lvl = 10000000;
5353
App capp = null;
54+
System.out.println(api.getStats().getUsername());
5455
System.out.println(api.getAppManager().getApps());
5556
for (App app : api.getAppManager().getApps()) {
5657
if (!app.isInstalled() && app.getRequiredLevel() <= api.getStats().getLevel()) app.getAsInstallable().install();

src/main/java/net/olympiccode/vhackos/api/entities/impl/vHackOSAPIImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private void updateData() {
111111
stats.setLevel(Long.parseLong(object.optString("level", "0")));
112112
stats.setLevelPorcentage(Long.parseLong(object.optString("exppc", "0")));
113113
stats.setMoney(Long.parseLong(object.optString("money", "0")));
114-
stats.setUsername(object.optString("statsname"));
114+
stats.setUsername(object.optString("username"));
115115
stats.setNetcoins(Long.parseLong(object.optString("netcoins", "0")));
116116
stats.setRequiredExperience(Long.parseLong(object.optString("expreq", "0")));
117117
} catch (JSONException e) {

0 commit comments

Comments
 (0)